title | emoji | colorFrom | colorTo | sdk | sdk_version | app_file | pinned |
---|---|---|---|---|---|---|---|
FluxGradio |
🖼️ |
blue |
purple |
gradio |
4.37.2 |
app.py |
false |
This Gradio application provides an intuitive interface for generating images using various Black Forest Labs FLUX models hosted on the Together AI platform.
- Supports multiple FLUX models: Pro, Schnell, Dev, Canny, Depth, Redux, Kontext, and Kontext-Max
- Text-to-Image generation with detailed prompt control
- Image-to-Image generation with specialized models
- Adjustable parameters: Steps, CFG Scale, Seed, Dimensions, Number of Outputs
- Optional safety checker disabling (where applicable)
- Prompt suggestion helper using
deepseek-ai/DeepSeek-R1-0528-tput
for higher-quality creative prompts - Comprehensive Flux Model Guide with usage tips and best practices
- Improved gallery display with support for multiple images (up to 4 columns)
The flagship model offering premium quality generation for detailed, photorealistic images. It handles complex scenes with excellent composition and fine details.
Best for:
- Professional illustrations and concept art
- Detailed landscapes and environments
- Photorealistic product visualizations
- Complex scenes with multiple elements
Example prompt:
A serene Japanese garden at sunset, with a wooden bridge crossing a koi pond. Cherry blossom petals gently float on the water's surface. Golden hour lighting casts long shadows across moss-covered stones. Cinematic composition, f/2.8 aperture, shot on Hasselblad.
Optimized for speed with a maximum of 12 inference steps. Produces good quality images significantly faster than other models.
Best for:
- Rapid prototyping and ideation
- Quick concept testing
- Situations where quantity of variations is prioritized over ultimate quality
- Time-sensitive projects
Example prompt:
Futuristic cyberpunk street market, neon lights, holographic advertisements, street food vendors, rain-slicked streets
A well-balanced model offering a good compromise between generation quality and speed.
Best for:
- Everyday use cases
- Balanced workflow where both quality and speed matter
- General-purpose image generation
- Testing prompts before using Pro for final versions
Example prompt:
A cozy reading nook in a forest cottage. Warm lighting from vintage lamps illuminates stacks of leather-bound books. A large window overlooks a misty forest. Comfortable armchair with a knitted blanket. Warm color palette.
Uses edge detection to preserve the outlines and structure of your source image.
Best for:
- Converting sketches to finished artwork
- Maintaining exact poses and compositions
- Preserving structural elements while changing style
- Working from line drawings or wireframes
Example workflow:
- Upload a sketch or line drawing
- Prompt: "Transform this sketch into a detailed watercolor painting of a fantasy castle with vibrant colors and intricate details"
Uses depth maps to maintain spatial relationships from the source image.
Best for:
- Preserving 3D structure while changing style
- Architectural visualization alternatives
- Interior design transformations
- Landscape redesigns
Example workflow:
- Upload a photo of a room interior
- Prompt: "Convert this space into a minimalist Scandinavian interior with natural wood elements, neutral color palette, and abundant natural light"
Creates variations of input images while maintaining core elements.
Best for:
- Exploring different artistic interpretations
- Testing different lighting or mood variations
- Style transfers that respect original composition
- Creating multiple variations of a core concept
Example workflow:
- Upload a portrait photograph
- Prompt: "Reimagine this portrait in the style of a Renaissance oil painting with dramatic Rembrandt lighting, rich dark background, and warm color palette"
A fast image-to-image model that excels at understanding and replicating the visual context of a reference image. It's highly effective at capturing style, mood, and composition.
Best for:
- Style transfer
- Character consistency
- Generating variations that are visually harmonious with a source image
- Rapid context-aware iterations (max 12 steps)
Example workflow:
- Upload an image with a distinct artistic style (e.g., a Van Gogh painting)
- Prompt: "A modern cityscape at night, in the style of the reference image"
A professional-grade version of Kontext for maximum quality and detail, supporting up to 50 inference steps.
Best for:
- High-fidelity style transfer
- Detailed character replication
- Complex context-aware generation tasks where quality is paramount
Example workflow:
- Upload a detailed character portrait
- Prompt: "The same character, now wearing futuristic armor and standing on a spaceship bridge"
For image-to-image models (FLUX.1-canny, FLUX.1-depth, FLUX.1-redux), we use the image_url
parameter with a data URI format:
data_url = f"data:image/png;base64,{base64_img}"
args["image_url"] = data_url
This ensures that the images are properly passed to the Together AI API in a format it can process.
The application automatically handles model-specific constraints:
- FLUX.1-schnell: Maximum of 12 inference steps
- FLUX.1.1-pro, FLUX.1-schnell, FLUX.1-kontext, and FLUX.1-kontext-max: Cannot disable safety filter
- All models: Dynamic resizing of large input images to prevent "Request Entity Too Large" errors
The application includes a powerful prompt suggestion feature powered by deepseek-ai/DeepSeek-R1-0528-tput
, a state-of-the-art language model. This helper can transform simple themes into detailed, effective prompts that produce better results with image generation models.
Example:
- Input theme: "underwater city"
- Generated prompt: "A magnificent underwater metropolis with bioluminescent buildings made of coral and crystal, connected by transparent tubes. Schools of colorful fish swim between the structures while majestic manta rays glide overhead. The city is illuminated by an ethereal blue-green glow, creating dramatic light rays that pierce through the deep water. Photorealistic rendering with dramatic depth and perspective."
- Clone this repository or create a new Space on Hugging Face
- Upload
app.py
,requirements.txt
, and thisREADME.md
- Go to your Space settings -> Secrets -> Add a new secret named
TOGETHER_API_KEY
and paste your Together AI API key as the value - The Space should build and launch the Gradio interface
If you encounter any errors:
- Verify your Together API key is correctly set in the Space secrets
- Check the model-specific limitations mentioned above
- For image-to-image models, ensure you've uploaded a compatible image
- The app automatically adjusts parameters like 'steps' when using specific models with constraints