Spaces:
Sleeping
Download README.md from OneWeekApp/space-ac-design: direct link, hf CLI and curl.
- Browser
- Download file 8.86 kB
-
https://huggingface.co/spaces/OneWeekApp/space-ac-design/resolve/main/README.md
- Command line
-
hf download hf://spaces/OneWeekApp/space-ac-design/README.md
-
curl -L -o README.md https://huggingface.co/spaces/OneWeekApp/space-ac-design/resolve/main/README.md
A newer version of the Gradio SDK is available: 6.32.0
title: Space AC Design Variations
emoji: π¨
colorFrom: purple
colorTo: pink
sdk: gradio
sdk_version: 5.49.0
app_file: app.py
pinned: false
license: mit
π¨ Space AC: Design Variations
AI-powered design system generation for Flutter apps
Part of the AI Software Factory - a complete system that generates Flutter applications from Notion wireframes to GitHub PRs.
π Features
This space contains specialized AI agents for design system generation:
β‘ Simple Generator (NEW!) β LIVE
- Zero-configuration Flutter code generation
- Prompt β DeepSeek β Flutter Code β DartPad (auto-loaded!)
- Automatic GitHub Gist creation for instant DartPad embedding
- No themes, no presets - just describe what you want
- Code automatically loaded in DartPad - just click "Run"!
- Collapsible code viewer for clean UI
Example prompts:
- "Create a modern login screen with email and password"
- "Generate a fitness app home page with statistics cards"
- "Build a todo list with checkboxes and delete buttons"
AC1: Moodboard Analyzer πΌοΈ β LIVE
- Analyzes reference app screenshots
- Extracts color palettes with visual previews
- Identifies UI patterns and components
- Detects typography trends
- Generates actionable design insights
AC2: Design Variation Generator π¨ β LIVE
- Generates 4 complete design theme variations
- Defines design tokens (colors, typography, spacing)
- Creates comprehensive design system specifications
- Interactive theme cards with visual preview
AC3: Flutter Screen Generator π» β LIVE
- Generates runnable Flutter/Dart code for DartPad
- AI-powered planning with Llama 3.1 70B + Jinja2 templates
- Creates 3 screens per theme with realistic components
- Supports 10 app types (fitness, banking, rider, ecommerce, social, etc.)
- 400-500 lines of production-ready Dart code per screen
Coming Soon:
- AC4: Theme Comparator (pros/cons analysis and recommendations)
π― Use Cases
- Design System Creation: Generate complete design systems from inspiration
- Theme Development: Create multiple design variations quickly
- Competitor Analysis: Analyze design patterns from reference apps
- Design Documentation: Auto-generate design tokens and guidelines
π§ API Endpoints
POST /api/moodboard-analyzer
Analyze a moodboard to extract design insights.
Request:
{
"reference_images": [
{
"url": "https://example.com/screenshot.png",
"description": "Instagram home feed - dark mode"
}
],
"mood_keywords": ["energetic", "gaming", "modern"]
}
Response:
{
"success": true,
"output": {
"analysis": {
"color_palettes": [...],
"typography_trends": [...],
"ui_patterns": [...],
"insights": "..."
}
}
}
POST /api/design-variation-generator
Generate 4 design theme variations from moodboard analysis.
Request:
{
"moodboard_analysis": {
"color_palettes": [...],
"typography_trends": [...],
"ui_patterns": [...]
},
"wireframe": "E-commerce app with product grid and checkout",
"app_context": {
"type": "mobile_app"
}
}
Response:
{
"success": true,
"output": {
"themes": [
{
"name": "Bold Energy",
"style": "bold",
"palette": {...},
"typography": {...},
"spacing": {...},
"component_style": {...},
"animations": {...}
}
]
}
}
POST /api/flutter-screen-generator
Generate Flutter/Dart code from design themes (AC3).
Request:
{
"theme": {
"name": "Bold Energy",
"palette": {...},
"typography": {...},
"spacing": {...}
},
"app_type": "fitness",
"screens": ["home", "profile", "settings"]
}
Response:
{
"success": true,
"output": {
"screens": [
{
"name": "home",
"code": "import 'package:flutter/material.dart';\n\n// Full Dart code...",
"lines": 487,
"components": ["StatsCard", "HeroBanner"],
"status": "generated"
}
],
"theme_name": "Bold Energy",
"app_type": "fitness",
"total_lines": 1420
}
}
Note: Requires HF_TOKEN environment variable for Llama 3.1 access.
π Environment Variables
To enable all features, you need to configure the following environment variables:
HuggingFace Token (Required for AC1, AC2, AC3)
All three agents use HuggingFace Inference API to access Llama models.
- Get your token from HuggingFace Settings
- Create a
.envfile in the project root:
cp .env.example .env
- Add your token to
.env:
HF_TOKEN=your_huggingface_token_here
On HuggingFace Spaces:
- Go to Space Settings β Variables
- Add
HF_TOKENas a secret
Note: Without the token, agents will use fallback/mock data.
GitHub Token (Required for Simple Generator Auto-load DartPad)
The Simple Generator feature automatically loads generated Flutter code into DartPad by creating GitHub Gists.
Required for:
- β‘ Simple Generator β Auto-load code in DartPad
Setup Instructions:
Create a GitHub Personal Access Token (classic):
- Go to GitHub Settings β Tokens
- Click "Generate new token (classic)"
- Give it a name like "HF Space Gist Creator"
- Select scopes:
gist(only this scope is needed) - Click "Generate token"
- Copy the token (you won't see it again!)
Add to
.envfile:
GITHUB_TOKEN=ghp_yourGitHubTokenHere
On HuggingFace Spaces:
- Go to Space Settings β Variables
- Add
GITHUB_TOKENas a secret (not a public variable!)
Note: Without this token, the Simple Generator will still work, but users will need to manually copy-paste code into DartPad instead of automatic loading.
π» Local Development
# Clone the repository
git clone https://huggingface.co/spaces/OneWeekApp/space-ac-design
cd space-ac-design
# Install dependencies
pip install -r requirements.txt
# Configure environment variables
cp .env.example .env
# Edit .env and add your HuggingFace token
# Run locally
python app.py
The Gradio interface will be available at http://localhost:7860
π§ AI Models Used
- DeepSeek Coder - Direct Flutter code generation (Simple Generator)
- Llama 3.2 Vision (11B) - Image analysis (AC1)
- Llama 3.1 (70B) - Text generation and synthesis (AC2)
- Llama 3.1 (70B) - Flutter code planning (AC3)
- Jinja2 Templates - Dart code generation (AC3)
π Example Usage
Python
import requests
response = requests.post(
"https://OneWeekApp-space-ac-design.hf.space/api/moodboard-analyzer",
json={
"reference_images": [
{"description": "Instagram dark mode", "url": ""}
],
"mood_keywords": ["energetic", "gaming"]
}
)
result = response.json()
palettes = result["output"]["analysis"]["color_palettes"]
print(palettes)
cURL
curl -X POST https://OneWeekApp-space-ac-design.hf.space/api/moodboard-analyzer \
-H "Content-Type: application/json" \
-d '{
"reference_images": [{"description": "Uber driver app", "url": ""}],
"mood_keywords": ["professional", "modern"]
}'
ποΈ Architecture
This space is part of the AI Software Factory system:
Notion Wireframe
β
Space AC (Design) β You are here
β
Space A (Architecture)
β
Space B (Code Generation)
β
Spaces C-N (Testing, DB, Platform, etc.)
β
GitHub PR with complete Flutter app
π Input Examples
Gaming/Energetic Theme
Reference Images:
- PUBG Mobile home screen - dark mode, neon accents
- Fortnite battle pass - vibrant colors, bold typography
- Uber driver stats - clean cards, green highlights
Mood: gaming, energetic, bold
Professional Theme
Reference Images:
- LinkedIn feed - white cards, blue accents
- Banking app - clean layout, trust signals
- Notion workspace - minimal, organized
Mood: professional, trustworthy, modern
π Related Spaces
Part of the AI Software Factory ecosystem:
- space-a-architecture - System architecture design
- space-b-codegen - Flutter code generation
- space-c-testing-white - Unit & widget tests
- space-d-testing-black - E2E tests
- space-e-database - Database & backend
π License
MIT License
π€ Contributing
This space is part of a research project. Contributions welcome!
π§ Contact
- GitHub: AI Software Factory
- Space: OneWeekApp/space-ac-design
Built with β€οΈ using Gradio, FastAPI, and HuggingFace Inference API