8.5 KiB
ComfyUI Batching Nodes - Examples & Tutorials
This document provides detailed examples and tutorials for using the ComfyUI Batching Nodes.
Table of Contents
Prompt Batching Examples
Example 1: Generate Character Variations
Goal: Create 4 different character portraits
Workflow:
- Add Batch Text node
- Enter prompts:
a warrior in plate armor, fantasy art, detailed
a mage with staff, mystical aura, fantasy art, detailed
a rogue in leather armor, fantasy art, detailed
a cleric with holy symbol, fantasy art, detailed
- Connect to CLIP Text Encode → Checkpoint → KSampler → VAE Decode → Save Image
- Queue once → Get 4 images automatically!
Tip: Use consistent formatting across prompts for style consistency.
Example 2: Test Different Art Styles
Goal: See the same subject in different artistic styles
Workflow:
- Add Batch Text node with delimiter
, - Enter prompts:
oil painting style, portrait of a cat, classical art
watercolor style, portrait of a cat, soft colors
digital art style, portrait of a cat, vibrant
pencil sketch style, portrait of a cat, detailed lines
- Connect to your standard workflow
- Use same seed for all to compare styles fairly
Result: 4 images of the same subject in different styles
Example 3: Product Description Variations
Goal: Generate product images with different descriptions
Workflow:
- Add Batch Text node
- Enter prompts:
professional product photography, studio lighting, white background
product in natural environment, outdoor setting
lifestyle product shot, in use, realistic
product detail close-up, macro photography
- Process through your workflow
Image Batching Examples
Example 4: Upscale Entire Photo Collection
Goal: Upscale 50 vacation photos at once
Workflow:
- Add Batch Images node
- Set
folder_path:/path/to/vacation_photos - Set
image_extensions:jpg,jpeg - Set
sort_by:name - Set
max_images:0(all images) - Connect: Batch Images → VAE Encode → Upscale Model → VAE Decode → Save Image
- Queue once → All 50 photos processed!
Time saved: Instead of 50 manual loads, just one click!
Example 5: Apply Face Restoration to Generated Images
Goal: Fix faces in a batch of AI-generated images
Workflow:
- Place generated images in folder:
/input/faces_to_fix - Add Batch Images node
- Set
folder_path:/input/faces_to_fix - Connect: Batch Images → Face Restore Node → Save Image
- All faces fixed automatically
Example 6: Convert Image Format in Batch
Goal: Convert 100 WebP images to PNG
Workflow:
- Add Batch Images node
- Set
folder_path:/input/webp_images - Set
image_extensions:webp - Connect: Batch Images → Save Image (with PNG format)
- All converted in one go!
Example 7: Process Only Recent Photos
Goal: Process photos from last week only
Workflow:
- Add Batch Images node
- Set
folder_path:/input/all_photos - Set
sort_by:modified - Set
max_images:20(or however many you expect) - Process newest first
Combined Batching Examples
Example 8: Style Transfer Matrix
Goal: Apply 3 different styles to 5 different images (15 total outputs)
Workflow:
- Add Batch Text node with 3 style prompts:
in the style of Van Gogh, impressionist
in the style of Picasso, cubist
in the style of Monet, post-impressionist
-
Add Batch Images node pointing to folder with 5 images
-
Connect both to your style transfer workflow
-
Result: 3 styles × 5 images = 15 unique combinations!
Matrix visualization:
Image1 Image2 Image3 Image4 Image5
Van Gogh ✓ ✓ ✓ ✓ ✓
Picasso ✓ ✓ ✓ ✓ ✓
Monet ✓ ✓ ✓ ✓ ✓
Example 9: A/B Testing Prompts on Same Images
Goal: Test which prompt works better on your test images
Workflow:
- Batch Text with 2 prompt variations:
high quality, detailed, professional photography
ultra realistic, 8k, photorealistic, award winning
-
Batch Images with 10 test images
-
Connect both to KSampler with SAME SEED
-
Result: 20 images (2 prompts × 10 images) to compare
Example 10: Product Mockup Generator
Goal: Place product in different environments
Workflow:
- Batch Images: Product photos from different angles (3 images)
- Batch Text: Different environment descriptions (4 prompts)
in modern kitchen, bright lighting
in cozy living room, warm atmosphere
in professional office, clean design
in outdoor garden, natural light
- Connect both to ControlNet workflow
- Result: 12 product mockups (3 angles × 4 environments)
Advanced Techniques
Technique 1: Resume Interrupted Batches
If your batch processing was interrupted:
Workflow:
- Check how many images were already processed
- Use
start_indexto skip processed images - Continue from where you left off
Example:
First run: max_images: 50, start_index: 0 → Process images 0-49
Interrupted at image 30!
Resume run: max_images: 0, start_index: 30 → Process images 30-end
Technique 2: Process in Chunks for Memory Management
For very large batches:
Workflow:
- First chunk:
start_index: 0, max_images: 100 - Second chunk:
start_index: 100, max_images: 100 - Third chunk:
start_index: 200, max_images: 100 - Continue until done
Technique 3: Organized File Naming
Use the filenames output for smart saving:
Workflow:
- Batch Images → outputs both
imagesandfilenames - Use a String manipulation node to modify filename
- Pass modified filename to Save Image node
- Result: Organized output with meaningful names
Technique 4: Conditional Processing
Process only certain images based on properties:
Pseudo-workflow:
- Load images with Batch Images
- Use image dimensions checker (custom node)
- Filter to only portrait orientation
- Process filtered batch
Technique 5: Delimiter Tricks
Comma-separated for CSV-like input:
Delimiter: ","
Input: "cat, sitting, indoors, cute, cat, playing, outdoors, energetic"
Result: 4 prompts (assuming word pairs)
Multi-line for complex prompts:
Delimiter: "\n\n" (double newline)
Input: "A detailed description
that spans multiple lines
for one prompt.
A second detailed description
also spanning lines
for the second prompt."
Result: 2 prompts
Tips for Best Results
For Prompt Batching:
- Keep prompts similar in structure for consistency
- Use the same seed to isolate prompt variations
- Test with 3-5 prompts first before large batches
- Include quality tokens in all prompts if needed
For Image Batching:
- Name files with leading zeros for proper sorting (001, 002, etc.)
- Test with
max_images: 5first to verify workflow - Use absolute paths for
folder_path - Check console for loading confirmation messages
For Combined Batching:
- Understand multiplication: N prompts × M images = N×M outputs
- Start small (2×2 = 4) to test before large matrices
- Monitor memory usage
- Use consistent seeds for fair comparisons
Common Workflows Summarized
| Goal | Nodes Used | Key Settings |
|---|---|---|
| Multiple prompt variations | Batch Text | Different prompts, same settings |
| Upscale folder of images | Batch Images | max_images: 0 |
| Test styles on one subject | Batch Text | Same subject, different styles |
| Process recent photos | Batch Images | sort_by: modified, max_images: N |
| Style transfer matrix | Both nodes | Multiple styles × multiple images |
| Resume interrupted batch | Batch Images | start_index: N |
| Convert image formats | Batch Images | Load one format, save another |
| Character sheet generation | Batch Text | Different angles/views |
Getting Help
If you need help with any of these examples:
- Check the console for error messages
- Verify your node connections
- Start with simple examples first
- Open an issue on GitHub with your workflow JSON
Happy batching! 🚀