Spaces:
Running
on
Zero
Running
on
Zero
A newer version of the Gradio SDK is available:
6.2.0
metadata
title: FLUX.2 Text to Image
emoji: 🖼
colorFrom: purple
colorTo: red
sdk: gradio
sdk_version: 6.0.2
app_file: app.py
pinned: true
license: apache-2.0
short_description: Generate production-grade AI images using FLUX.2 [dev]
FLUX.2 [dev] Text-to-Image
Generate high-quality images using FLUX.2 [dev], a 32B parameter rectified flow model by Black Forest Labs.
Features
- Text-to-Image Generation: Create images from text prompts
- Image Editing: Upload images for editing and manipulation
- Image Combining: Combine multiple images based on text instructions
- Prompt Upsampling: Automatically enhance prompts using a VLM (optional)
- ZeroGPU Support: Optimized for ZeroGPU inference
- Advanced Controls: Fine-tune generation with seed, guidance scale, inference steps, and dimensions
Setup
This Space requires:
- ZeroGPU: Enable ZeroGPU in your Space settings
- HF_TOKEN: Set your Hugging Face token as a Space secret for gated model access
- Go to Settings → Secrets → Add
HF_TOKENwith your Hugging Face token
- Go to Settings → Secrets → Add
Model
- Model: black-forest-labs/FLUX.2-dev
- Blog: FLUX.2 Announcement
Usage
- Enter a text prompt describing the image you want to generate
- (Optional) Upload one or more images for editing/combining
- Adjust advanced settings as needed:
- Prompt Upsampling: Enable to automatically enhance your prompt
- Seed: Control randomness (use randomize for variety)
- Dimensions: Width and height (must be multiples of 8)
- Inference Steps: More steps = higher quality but slower (default: 30)
- Guidance Scale: How closely to follow the prompt (default: 4.0)
- Click "Run" to generate your image
Notes
- The model uses pre-compiled blocks for ZeroGPU optimization
- Prompt upsampling requires a valid
HF_TOKENsecret - Image dimensions are automatically adjusted when uploading images
- Supports image editing and combining multiple images
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference