Spaces:
Running
Running
metadata
title: SeedDream v4 Edit
emoji: π¨
colorFrom: purple
colorTo: pink
sdk: docker
app_port: 7860
pinned: false
license: mit
SeedDream v4 - AI Image Generator & Editor
A web-based interface for AI-powered image generation and editing using ByteDance's SeedDream v4 models via the FAL API. This application is containerized and ready for deployment on Hugging Face Spaces.
Features
- π¨ Dual Mode: Switch between Image Editing and Text-to-Image generation
- π€ Support for multiple image uploads (up to 10 images for editing)
- π URL-based image input support
- βοΈ Customizable generation settings with smart dimension detection
- π Safety checker disabled for unrestricted creativity
- π³ Docker containerized for easy deployment
- π Hugging Face Spaces compatible
Quick Start
Local Development
Clone the repository
git clone <your-repo-url> cd fal_uiInstall dependencies
# Install Python dependencies pip install -r requirements.txtRun the application
python app.pyThe app will be available at
http://localhost:7860
Docker Deployment
Build the Docker image
docker build -t seedream-editor .Run the container
docker run -p 7860:7860 seedream-editor
Deployment on Hugging Face Spaces
Method 1: Direct Deployment
- Go to Hugging Face Spaces
- Click "Create new Space"
- Choose "Docker" as the SDK
- Upload all project files
- The application is ready to deploy - users will enter their API key directly in the interface
Method 2: Using Git
Create a new Space on Hugging Face
Clone your space locally:
git clone https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME cd YOUR_SPACE_NAMECopy all project files to the space directory
Create a
.gitignorefile:__pycache__/ *.pyc .envPush to Hugging Face:
git add . git commit -m "Initial commit" git push
Configuration
API Key
The FAL API key is entered directly in the web interface:
- Enter your API key in the "API Configuration" section at the top of the page
- The key is stored locally in your browser (localStorage)
- Get your API key from fal.ai
Model Selection
Choose between two powerful models:
- Image Edit Mode:
fal-ai/bytedance/seedream/v4/edit- Edit existing images with prompts - Text-to-Image Mode:
fal-ai/bytedance/seedream/v4/text-to-image- Generate new images from text
Environment Variables
PORT: Port number (default: 7860)SPACE_ID: Automatically set by Hugging Face Spaces
Project Structure
fal_ui/
βββ app.py # Flask application
βββ requirements.txt # Python dependencies
βββ Dockerfile # Docker configuration
βββ templates/
β βββ index.html # Frontend interface
βββ static/
β βββ style.css # Styling
β βββ script.js # Frontend logic
βββ README.md # Documentation
Features Overview
Image Input
- File Upload: Select multiple images from your device
- URL Input: Paste image URLs directly
- Preview: Visual preview of uploaded images
Generation Settings
- Image Size: Preset sizes or custom dimensions (1024-4096px)
- Number of Generations: Control output quantity
- Seed: Optional seed for reproducible results
- Safety Checker: Toggle content filtering
API Integration
- Automatic API key management
- Real-time progress logging
- Error handling and status updates
Security Notes
- Never expose your FAL API key in client-side code
- The application uses server-side proxy for API calls
- API keys can be stored in environment variables or Hugging Face secrets
Troubleshooting
Common Issues
API Key Error
- Ensure you've entered your FAL API key in the interface
- Check if the key has proper permissions
- Get a new key from fal.ai if needed
Docker Build Fails
- Verify all files are in the correct directories
- Check Docker daemon is running
Hugging Face Deployment Issues
- Ensure Dockerfile is present
- Check logs in the Space settings
Support
For issues related to:
- FAL API: Visit fal.ai documentation
- Hugging Face Spaces: Check Hugging Face documentation
License
This project is provided as-is for educational and development purposes.
Acknowledgments
- Powered by FAL.ai
- ByteDance SeedDream v4 model
- Deployed on Hugging Face Spaces