Fashion Prompt Builder Demo
A modern, responsive web application for generating prompts for fashion model generation. Built with Next.js 14, Tailwind CSS, and TypeScript.
Overview
The Fashion Prompt Builder is a Next.js web application that helps you create high-quality prompts for AI fashion model generation. It provides three different modes to craft prompts: a template-based builder, a gallery of examples, and a raw editor for advanced users.
Features
🎨 Prompt Builder
- Template-based generation: Choose from multiple templates for different fashion styles
- Dynamic parameters: Fill in model attributes (age, gender, appearance, pose, outfit, etc.)
- Real-time preview: See your generated prompt as you fill in parameters
- Parameter validation: Get warnings for missing required fields
- Model selection: Support for multiple AI models (Google Nano Banana, Flux.1-Kontext Pro, etc.)
🖼️ Prompt Gallery
- Example prompts: Browse through pre-made fashion model prompts
- Interactive selection: Click any example to load it into the editor
- Visual feedback: See selected prompts highlighted with checkmarks
- Metadata display: View word count and character count for each prompt
- Grid layout: Responsive 2-column grid for easy browsing
✍️ Raw Prompt Editor
- Advanced mode: Full control over prompt creation
- Live statistics: Real-time word and character count
- Rich placeholder: Example prompt included in placeholder text
- Tips & best practices: Expandable accordion with comprehensive guidance
- Load from builder: Import prompts generated from the builder
🎯 Additional Features
- Toast notifications: Beautiful, non-intrusive notifications for user feedback
- Responsive design: Optimized for desktop, tablet, and mobile devices
- Modern UI: Gradient backgrounds, smooth animations, and professional styling
- Accessibility: Proper focus states, keyboard navigation, and screen reader support
Quick Start
Prerequisites
- Node.js 18+ installed
- npm or yarn package manager
Installation
- Navigate to the demo directory:
cd demo/fashion-prompt-builder
- Install dependencies:
npm install
- Run the development server:
npm run dev
- Open http://localhost:3000 in your browser
Project Structure
fashion-prompt-builder/
├── app/
│ ├── layout.tsx # Root layout with metadata
│ ├── page.tsx # Main page component with all tabs
│ └── globals.css # Global styles and Tailwind configuration
├── components/
│ └── ui/ # Reusable UI components
│ ├── button.tsx # Button component with variants
│ ├── input.tsx # Input, Textarea, and Select components
│ ├── card.tsx # Card components
│ ├── tabs.tsx # Tab navigation component
│ ├── accordion.tsx # Accordion component for collapsible sections
│ └── toast.tsx # Toast notification component
├── lib/
│ └── utils.ts # Utility functions (cn helper)
└── public/
├── prompt_templates.json # Template definitions for different models
└── prompts.json # Example prompts for gallery
Tech Stack
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first CSS framework with custom color palette
- React 18 - UI library
- React Icons - Icon library (Heroicons v2)
Usage
Prompt Builder Flow
- Select a model (e.g., "Google Nano Banana")
- Choose a template style
- Fill in the required parameters (age, gender, appearance, etc.)
- Click "Generate Prompt" to create your prompt
- Review and edit the generated prompt
- Click "Use This Prompt" to proceed
Prompt Gallery Flow
- Browse through example prompts
- Click on any prompt to load it into the editor
- Edit the prompt if needed
- Click "Use This Prompt" to proceed
Raw Prompt Flow
- Type your custom prompt directly
- Use the tips accordion for guidance
- Monitor word and character count
- Optionally load a prompt from the builder
- Click "Use This Prompt" to proceed
Parameter Groups
The Prompt Builder organizes parameters into logical groups:
- Basic Information: Age, Gender
- Appearance: Complexion, Hair, Eyes, Face Shape
- Pose & Styling: Pose, Outfit
- Scene Settings: Lighting, Background, Fabric Description
Design System
Color Palette
- Primary:
#1FA08F(Teal) - Main brand color - Secondary:
#486876(Blue-gray) - Secondary accents - Neutral Dark:
#131E32- Text and dark elements - Neutral Light:
#BDB7C0- Subtle backgrounds
Custom Components
- Button: Primary, secondary, and outline variants
- Input/Textarea/Select: Styled form inputs with focus states
- Card: Container component with header and content sections
- Tabs: Tab navigation with active state styling
- Accordion: Collapsible sections for organizing content
- Toast: Notification system with success, warning, and error types
Data Files
prompt_templates.json
Contains template definitions organized by model:
- Each model has multiple template styles
- Templates include placeholders for dynamic parameters
- Each template has a name, description, and template string
prompts.json
Contains example prompts for the gallery:
- Array of prompt objects with metadata
- Used to populate the Prompt Gallery tab
- Can be extended with more examples
Development
# Install dependencies
npm install
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run linter
npm run lint
Toast Notifications
- Success: Green toast for successful actions
- Warning: Yellow toast for warnings and missing fields
- Error: Red toast for errors
- Auto-dismisses after 4 seconds
- Manual close button available
Responsive Design
- Mobile-first approach
- Breakpoints: sm (640px), md (768px), lg (1024px)
- Adaptive layouts for all screen sizes
- Touch-friendly interactive elements
Future Enhancements
- Backend API integration for actual image generation
- Prompt history and favorites
- Export/import prompts
- Share prompts via URL
- Advanced prompt editing tools
- Template customization
Related Demos
- Extract Garment Demo - Garment extraction with Gradio
- Model Swap Demo - Model swapping with Gradio
- Outfit Generator Demo - Outfit generation with Gradio
Learn More
- Demo Source Code - View source code on GitHub
- API Reference - OpenTryOn API adapters
- Nano Banana - Nano Banana documentation