Generate Images with Replicate
Promptfoo config comparing five FLUX and Stable Diffusion XL image models on Replicate across eight photography and art genres.
Why it matters
Leverage the Replicate API to generate images based on provided prompts. This prompt chain automates the process of sending prompts to Replicate and receiving generated images.
Outcomes
What it gets done
Send image generation prompts to the Replicate API.
Receive and process image outputs from Replicate.
Automate image generation tasks.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/pfoo-replicate-image-generation | bash Overview
Replicate Image Generation
This Promptfoo example compares five image-generation models on Replicate - FLUX 1.1 Pro Ultra (standard and raw mode), FLUX Dev, FLUX Dev Realism, and Stable Diffusion XL - across eight genre-specific prompts spanning portrait, landscape, architecture, product, and wildlife photography. Use it as a template when comparing FLUX and Stable Diffusion model variants on Replicate for a specific photography or art use case.
What it does
This Promptfoo config compares five image-generation models hosted on Replicate, all generating at 1024x1024: FLUX 1.1 Pro Ultra (highest quality, up to 4MP, 1:1 aspect ratio, WebP output), the same model in "raw" mode for more authentic, less airbrushed photography, FLUX Dev (the open-source FLUX variant, 28 inference steps, guidance 3.5), FLUX Dev Realism (a photorealism-specialized variant with matching inference settings but a guidance_scale parameter instead of guidance), and Stable Diffusion XL as a comparison baseline (25 inference steps, guidance scale 7.5), pinned to a specific model version hash for reproducibility.
Eight test prompts cover distinct genres with real production-style detail: a photorealistic business headshot specifying natural lighting, shallow depth of field, and "shot on Canon R5, 85mm lens"; an artistic mountain landscape at golden hour painted in the style of Albert Bierstadt, oil on canvas; architectural visualization of a minimalist glass-and-concrete house at dusk; product photography of a luxury watch floating against a black background, commercial style; abstract expressionist art with vibrant blues and oranges referencing Pollock and Rothko; a cyberpunk cityscape with neon-lit wet streets, flying cars, and holographic ads in a Blade Runner aesthetic; an overhead restaurant-quality sushi platter shot; and wildlife photography of a lion in the African savanna at sunset, National Geographic style. Every test uses the same JavaScript assertion, checking that the output is a string containing Markdown image syntax (` - confirming an image was actually generated and returned as a link, not scoring the image's visual quality.
When to use - and when NOT to
Use it as a template for comparing FLUX and Stable Diffusion model variants on Replicate across a range of photography and art genres, when picking a default image model for a specific use case. Do not use it if you only need one fixed model, or if you're not using Replicate.
Inputs and outputs
Input: the YAML config - a shared prompt template and five provider configs with their own resolution, inference-step, and guidance settings - plus eight genre-specific image prompts. Output: Promptfoo's evaluation report confirming each model successfully returned a generated image link, for side-by-side visual comparison.
Integrations
Uses Promptfoo's replicate:image provider to call five different Replicate-hosted models: Black Forest Labs' FLUX family, xLabs AI's FLUX Dev Realism, and Stability AI's SDXL.
Who it's for
Teams choosing between FLUX and Stable Diffusion variants on Replicate who want to compare output across photorealistic, artistic, architectural, product, and other genres before picking a default model.
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.