Create Images From Text
Generates images from text prompts using Stability AI's Stable Diffusion models.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Connection Id - The connection ID from the Connect node (optional if API Key is provided directly).
- Image Save Path - Directory path where generated images will be saved. Images are automatically named as
txt2img_0.png,txt2img_1.png, etc. - Prompt - Text description of the desired image. Be specific and descriptive for best results.
Options
Authentication
- API Key - Stability AI API key (optional if using Connection ID). You can provide the API key directly instead of using a Connect node.
Model Selection
- Engine Id - Stability AI engine to use for image generation:
- Stable Diffusion XL 1.0 - Latest SDXL model, highest quality 1024x1024 images
- Stable Diffusion XL 0.9 - Previous SDXL version
- Stable Diffusion 1.5 - Classic SD 1.5, balanced performance (default)
- Stable Diffusion 2.1 - SD 2.1 for 512x512 images
Generation Settings
- Negative Prompt - Text describing elements to avoid in the generated image. Helps exclude unwanted features.
- Height - Height of the image in pixels (must be in increments of 64). Leave empty for default engine resolution.
- Width - Width of the image in pixels (must be in increments of 64). Leave empty for default engine resolution.
- Cfg Scale - How strictly the diffusion process adheres to the prompt (default: 7). Range: 1-35. Higher values follow the prompt more closely.
- Samples - Number of images to generate (1-10, default: 1). Generates multiple variations from the same prompt.
- Seed - Random noise seed (default: 0 for random). Use specific values for reproducible results.
- Steps - Number of diffusion steps to run (10-150, default: 50). More steps = better quality but slower generation.
Advanced Settings
-
Clip Guidance Preset - CLIP guidance preset for image generation quality:
- NONE - No CLIP guidance (default)
- FAST_BLUE - Fast with blue color bias
- FAST_GREEN - Fast with green color bias
- SIMPLE - Simple CLIP guidance
- SLOW - More precise guidance
- SLOWER - Even more precise
- SLOWEST - Maximum precision
-
Sampler - Sampling algorithm used for diffusion process:
- NONE - Use engine default (recommended)
- DDIM - Denoising Diffusion Implicit Models
- DDPM - Denoising Diffusion Probabilistic Models
- K_DPMPP_2M - DPM++ 2M Karras
- K_DPMPP_2S_ANCESTRAL - DPM++ 2S Ancestral
- K_DPM_2 - DPM 2
- K_DPM_2_ANCESTRAL - DPM 2 Ancestral
- K_EULER - Euler method
- K_EULER_ANCESTRAL - Euler Ancestral
- K_HEUN - Heun method
- K_LMS - Linear Multi-Step
-
Style Preset - Style preset to guide the image generation:
- NONE - No style preset (default)
- 3d-model - 3D rendered style
- analog-film - Analog film photography
- anime - Anime/manga style
- cinematic - Cinematic movie style
- comic-book - Comic book art
- digital-art - Digital artwork
- enhance - Enhanced details
- fantasy-art - Fantasy illustration
- isometric - Isometric perspective
- line-art - Line art/sketch
- low-poly - Low polygon 3D
- modeling-compound - Clay modeling style
- neon-punk - Cyberpunk neon
- origami - Paper folding style
- photographic - Realistic photography
- pixel-art - 8-bit pixel art
- tile-texture - Seamless texture
How It Works
The Create Images From Text node generates images from text descriptions using Stable Diffusion. When executed, the node:
- Validates the connection or creates a temporary client using provided credentials
- Validates the prompt and image save path
- Constructs the generation request with:
- Main prompt (positive weight)
- Negative prompt if provided (negative weight)
- Dimension settings (width/height)
- Generation parameters (steps, cfg_scale, seed, etc.)
- Style and sampler settings
- Sends the request to Stability AI API
- Receives base64-encoded images from the API
- Decodes and saves images to the specified directory
- Images are named sequentially: txt2img_0.png, txt2img_1.png, etc.
Requirements
- Either a valid Connection Id from Connect node OR direct API Key credentials
- Non-empty Prompt
- Valid Image Save Path (directory must exist)
- Sufficient Stability AI credits for image generation
Error Handling
The node will return specific errors in the following cases:
- Empty or missing Prompt
- Empty or missing Image Save Path
- Invalid Connection Id (when not using direct credentials)
- Height or Width not valid integers
- Height or Width not in increments of 64
- Cfg Scale, Samples, Seed, or Steps not valid integers
- Samples outside range of 1-10
- Steps outside range of 10-150
- API authentication errors (401)
- Insufficient credits (402)
- API rate limit errors (429)
- API service errors (500, 503)
Usage Notes
Prompt Engineering
- Be specific and detailed in your prompts
- Include style descriptors (e.g., "oil painting", "digital art", "photorealistic")
- Specify important details (lighting, composition, colors)
- Mention artists or art styles for specific aesthetics
- Use comma-separated descriptors for clarity
Negative Prompts
- Use to exclude unwanted elements (e.g., "blurry, low quality, distorted")
- Common negative prompts: "ugly, deformed, low resolution, watermark"
- Helps avoid common AI artifacts
Image Dimensions
- Must be multiples of 64 (e.g., 512, 576, 640, 704, 768, 832, 896, 960, 1024)
- Different engines have recommended sizes:
- SDXL models: 1024x1024 (square) or 1024x768, 768x1024 (landscape/portrait)
- SD 1.5: 512x512 (square) or 512x768, 768x512
- SD 2.1: 512x512 or 768x768
- Larger images consume more credits and take longer to generate
Generation Parameters
- Cfg Scale: 7-10 for most use cases, 15-20 for very strict prompt following
- Steps: 30-50 for good quality, 50-150 for maximum quality
- Seed: Use 0 for random, or specific number to reproduce exact images
- Samples: Generate multiple variations to choose the best result
Examples
Example 1: Basic Image Generation
Inputs:
- Connection Id: (from Connect node)
- Image Save Path: "/path/to/output"
- Prompt: "A serene mountain landscape at sunset, oil painting style"
Options:
- Engine Id: Stable Diffusion 1.5
- Steps: 50
- Cfg Scale: 7
Result:
Generates a single 512x512 image saved as /path/to/output/txt2img_0.png
Example 2: High-Quality SDXL Generation
Inputs:
- Connection Id: (from Connect node)
- Image Save Path: "/path/to/output"
- Prompt: "Professional portrait photo of a software developer working on code, natural lighting, modern office, highly detailed, 8k quality"
- Negative Prompt: "cartoon, anime, illustration, blurry, low quality"
Options:
- Engine Id: Stable Diffusion XL 1.0
- Width: 1024
- Height: 1024
- Steps: 40
- Cfg Scale: 8
- Style Preset: photographic
Result: High-quality photorealistic 1024x1024 portrait
Example 3: Multiple Style Variations
Inputs:
- Connection Id: (from Connect node)
- Image Save Path: "/path/to/output"
- Prompt: "A fantasy dragon perched on a castle tower, epic scene"
Options:
- Engine Id: Stable Diffusion XL 1.0
- Samples: 4
- Steps: 50
- Seed: 0
Result: Generates 4 different variations: txt2img_0.png through txt2img_3.png
Example 4: Specific Style - Anime
Inputs:
- Connection Id: (from Connect node)
- Image Save Path: "/path/to/output"
- Prompt: "A cute anime girl with blue hair, magical girl outfit, sparkles, vibrant colors"
- Negative Prompt: "realistic, photo, 3d render"
Options:
- Engine Id: Stable Diffusion 1.5
- Style Preset: anime
- Steps: 40
- Cfg Scale: 10
Result: Anime-style character illustration
Example 5: Reproducible Results
Inputs:
- Connection Id: (from Connect node)
- Image Save Path: "/path/to/output"
- Prompt: "A red sports car on a coastal highway"
Options:
- Engine Id: Stable Diffusion 1.5
- Seed: 12345
- Steps: 50
- Cfg Scale: 7
Result: Using the same seed will generate the exact same image every time
Example 6: RPA Use Case - Product Visualization
Flow:
Read CSV (product descriptions)
→ Loop through products
→ TextToImages (generate product image from description)
→ Rename file to product SKU
→ Upload to e-commerce platform
Inputs:
- Prompt: msg.productDescription (from CSV)
- Image Save Path: "/temp/product_images"
Options:
- Engine Id: Stable Diffusion XL 1.0
- Style Preset: photographic
- Width: 1024
- Height: 1024
Example 7: RPA Use Case - Marketing Material Generation
Flow:
Read campaign requirements
→ Generate hero image (TextToImages)
→ Generate thumbnail variations (TextToImages with Samples: 5)
→ Select best image (manual or AI selection)
→ Resize and optimize
→ Upload to content management system
Inputs:
- Prompt: "Modern tech startup office, collaborative workspace, diverse team working together, bright and energetic atmosphere, professional photography"
- Negative Prompt: "dark, gloomy, empty, stock photo watermark"
Options:
- Engine Id: Stable Diffusion XL 1.0
- Width: 1920
- Height: 1080
- Samples: 3
- Style Preset: photographic
Example 8: RPA Use Case - Social Media Automation
Flow:
Read social media calendar
→ For each scheduled post
→ TextToImages (generate post image)
→ Add text overlay (Image Processing)
→ Resize for platform (Instagram, Twitter, etc.)
→ Upload to social media scheduler
Inputs:
- Prompt: msg.postTheme + ", eye-catching, social media style, vibrant colors"
- Image Save Path: "/temp/social_images"
Options:
- Engine Id: Stable Diffusion XL 1.0
- Width: 1024
- Height: 1024
- Style Preset: digital-art
Best Practices
-
Prompt Quality:
- Start with the main subject
- Add style descriptors
- Include quality terms ("highly detailed", "8k", "professional")
- Specify composition ("centered", "wide angle", "close-up")
-
Negative Prompts:
- Always use negative prompts to avoid common artifacts
- Include: "blurry, low quality, distorted, deformed"
- Add medium-specific exclusions (e.g., "cartoon" for photographic style)
-
Engine Selection:
- SDXL 1.0: Best overall quality, higher cost
- SD 1.5: Balanced performance, good for most use cases
- SD 2.1: Alternative style, good for certain artistic styles
-
Cost Management:
- Start with lower step counts (30-40) for testing
- Generate multiple samples to get variations
- Use specific seeds to reproduce good results
- Monitor credit usage with GetUserCredit node
-
Quality Optimization:
- Use 40-50 steps for production quality
- Cfg Scale 7-12 for most use cases
- Enable appropriate style presets
- Use proper dimensions for your engine
-
File Management:
- Ensure output directory exists before running
- Implement file naming conventions for batch processing
- Clean up old generated images periodically
- Consider organizing by date or category
Tips for RPA Developers
- Batch Processing: Use loops to generate multiple images from data sources
- Error Recovery: Implement retry logic for API failures
- Credit Monitoring: Check credits before large batch operations
- Quality Control: Generate samples first, then scale up production
- A/B Testing: Generate variations with different parameters to find optimal settings
- Prompt Templates: Create reusable prompt templates for consistent results
- Caching Seeds: Store successful seeds for reproducible results