Generate images from text descriptions using state-of-the-art AI models like Flux Pro and Gemini. Convert any text prompt into high-quality images programmatically.
The Image Generation Node converts text prompts into images using AI models. It accepts a text description as input and outputs a base64-encoded image that can be displayed, downloaded, or passed to other nodes for further processing.
stringblack-forest-labs/flux-1.1-pro, black-forest-labs/flux-pro, gemini-2.5-flash-imagestring"Professional infographic showing GDPR data subject rights, modern flat design"string"1:1""1:1", "16:9", "9:16", "4:3", "3:4", "21:9"string"png""png", "jpeg", "webp"export type ImageGenerationNodeData = {
// Configuration
model: string // AI model identifier
aspectRatio?: string // Image dimensions ratio
outputFormat?: string // Output format (png/jpeg/webp)
// Execution state (managed by system)
status?: "idle" | "running" | "completed" | "error"
output?: {
url?: string // Base64 data URL
images?: string[] // Array of base64 images
text?: string // Optional description
}
error?: string
}Node Props:
import { NodeProps } from "@xyflow/react"
export function ImageGenerationNode({ data, id }: NodeProps<ImageGenerationNodeData>) {
// Component implementation
return (
<div className="image-generation-node">
<Handle type="target" position={Position.Left} />
<Handle type="source" position={Position.Right} />
{/* Node UI */}
</div>
)
}const workflow = {
nodes: [
{
id: "start-1",
type: "start",
data: {
input: "cybersecurity threat landscape"
}
},
{
id: "prompt-1",
type: "prompt",
data: {
template: "Create a professional diagram showing $input1, modern flat design"
}
},
{
id: "image-1",
type: "imageGeneration",
data: {
model: "black-forest-labs/flux-1.1-pro",
aspectRatio: "16:9"
}
},
{
id: "end-1",
type: "end"
}
],
edges: [
{ id: "e1", source: "start-1", target: "prompt-1" },
{ id: "e2", source: "prompt-1", target: "image-1" },
{ id: "e3", source: "image-1", target: "end-1" }
]
}const workflow = {
nodes: [
{
id: "start-1",
type: "start",
data: { input: "GDPR compliance" }
},
{
id: "text-1",
type: "textModel",
data: {
model: "gpt-4",
prompt: "Create a detailed image prompt for a professional infographic about $input1"
}
},
{
id: "image-1",
type: "imageGeneration",
data: {
model: "black-forest-labs/flux-1.1-pro",
aspectRatio: "1:1"
}
}
],
edges: [
{ id: "e1", source: "start-1", target: "text-1" },
{ id: "e2", source: "text-1", target: "image-1" }
]
}const workflow = {
nodes: [
{
id: "http-1",
type: "httpRequest",
data: {
url: "https://api.example.com/threat-data",
method: "GET"
}
},
{
id: "js-1",
type: "javascript",
data: {
code: "return JSON.parse(input1).threats.map(t => t.type).join(', ')"
}
},
{
id: "prompt-1",
type: "prompt",
data: {
template: "Create a heat map visualization showing these cyber threats: $input1"
}
},
{
id: "image-1",
type: "imageGeneration",
data: {
model: "gemini-2.5-flash-image", // Fast for real-time reports
aspectRatio: "16:9"
}
}
],
edges: [
{ id: "e1", source: "http-1", target: "js-1" },
{ id: "e2", source: "js-1", target: "prompt-1" },
{ id: "e3", source: "prompt-1", target: "image-1" }
]
}You need API keys from the respective providers:
Add your API keys via Settings → API Keys in the TopFlow builder interface.
Must select a valid image generation model
API key for selected provider (FAL or Google AI) must be configured
Image Generation node must receive prompt from upstream node
Prompt appears to be empty. Image generation may fail or produce unexpected results.
Prompts with less than 10 characters may produce low-quality images.
"Professional infographic showing GDPR data subject rights: access, rectification, erasure, restriction, portability, objection. Modern flat design, blue and white color scheme, icons for each right, clean layout"✅ Specific style, colors, elements described
"GDPR diagram"❌ Too vague, no style or detail
Cause: No API key configured for the selected model provider.
Solution: Click "API Keys" in the top toolbar and add your FAL or Google AI API key. Make sure you've selected the correct provider for your model.
Possible Causes:
Solutions: Verify API key is valid, wait 1 minute for rate limit reset, rephrase prompt to avoid content filters, or check network connection.
Cause: Vague prompt or suboptimal model selected.
Solution: Switch to black-forest-labs/flux-1.1-pro for better quality. Add more descriptive details to your prompt (style, colors, composition, specific elements). Use a Text Model node to enhance the prompt before generation.
Cause: High-quality model or large aspect ratio selected.
Solution: Switch to gemini-2.5-flash-image for 3-5x faster generation. Use square (1:1) aspect ratio for fastest results. Consider caching results to avoid regeneration.
Images are returned as base64-encoded data URLs in this format:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
Using the image in other nodes:
<img src="..." />Continue learning about image generation and related node types: