How It Works
Instead of starting from pure noise, img2img:- Encodes your input image to latent space
- Adds controlled noise (determined by denoise strength)
- Denoises using your prompt as guidance
- Decodes back to pixel space
- 0.0: No change (original image)
- 0.3-0.5: Subtle modifications, preserves composition
- 0.6-0.8: Significant changes, keeps general structure
- 0.9-1.0: Major transformation, minimal original influence
Basic Workflow
- IMAGE: The loaded image
- MASK: Alpha channel (if present)
- pixels: from LoadImage IMAGE output
- vae: from CheckpointLoaderSimple VAE output
oil painting style, impressionist brushstrokes, vibrant colorsphotorealistic, sharp edges, digital- model: from checkpoint
- positive: from positive prompt
- negative: from negative prompt
- latent_image: from VAEEncode
- denoise: 0.5-0.75 (key parameter for img2img)
- steps: 20-30
- cfg: 7-9
- sampler_name: euler or dpm++ 2m karras
Complete Workflow JSON
Common Use Cases
Style Transfer
Goal: Change artistic style while preserving content Settings:- Denoise: 0.5-0.7
- Prompt: Describe target style in detail
- CFG: 8-10 for strong style application
Upscaling and Enhancement
Goal: Increase resolution and add detail- Add ImageScale node before VAEEncode
- Set target dimensions (e.g., 2x original)
- Use low denoise (0.3-0.5)
- Prompt for enhanced details:
Sketch to Image
Goal: Turn rough sketches into detailed images Settings:- Denoise: 0.7-0.9 (high transformation)
- Detailed descriptive prompt
- Higher CFG (9-12)
Photo Restoration
Goal: Restore old or damaged photos Settings:- Denoise: 0.3-0.5 (preserve original)
- Steps: 30-40
- Sampler: ddim (deterministic)
Advanced Techniques
Two-Pass Workflow (Hires Fix)
Generate at low resolution, then upscale:- First pass: Generate at 512×512, denoise 1.0
- Add LatentUpscale node to 2x size
- Second pass: Same prompt, denoise 0.4-0.6
- Results in higher quality than direct high-res generation
Variation Generation
Create multiple variations of the same image:- Set denoise to 0.4-0.6
- Use RepeatLatentBatch to duplicate encoded image
- Each batch gets a different seed
- Generate multiple variations in one run
Image Blending
Blend two images:- Encode both images with VAEEncode
- Use LatentBlend node (if available)
- Set blend_factor (0.5 = equal mix)
- Denoise the blended result
Denoise Strength Guide
| Denoise | Effect | Use Case |
|---|---|---|
| 0.1-0.3 | Minimal change | Color correction, subtle enhancement |
| 0.3-0.5 | Moderate change | Upscaling, detail enhancement |
| 0.5-0.7 | Significant change | Style transfer, artistic transformation |
| 0.7-0.9 | Major change | Sketch to image, composition changes |
| 0.9-1.0 | Almost new | Using image as loose inspiration only |
Resolution Handling
Resizing Input
Use ImageScale to resize before encoding:- lanczos: Best for upscaling photos
- bicubic: Smooth results
- nearest-exact: Pixel art
- bilinear: Fast but softer
Aspect Ratio Preservation
Set either width or height to 0 for automatic scaling:Sampler Recommendations
For Photo Editing
- ddim: Deterministic, preserves details
- euler: Fast, good for previews
- Steps: 20-30
For Artistic Transformation
- dpm++ 2m karras: Quality/speed balance
- euler_ancestral: More variation
- Steps: 25-35
For High Fidelity
- dpm++ sde karras: Best quality
- ddim: Consistent results
- Steps: 30-50
Troubleshooting
Too much change from original
- Lower denoise strength (try 0.4)
- Reduce CFG scale (try 6-7)
- Use ddim sampler for more consistency
Not enough change
- Increase denoise (try 0.7-0.8)
- Raise CFG scale (try 9-11)
- Be more specific in prompt
- Increase steps to 30-40
Artifacts or distortion
- Check if image resolution is compatible (multiples of 8)
- Try different VAE
- Lower denoise strength
- Reduce CFG scale
Out of memory
- Scale down input image
- Use VAEEncodeTiled for very large images
- Reduce batch size
Tips and Best Practices
- Start conservative: Begin with denoise 0.5, adjust from there
- Match model training: Use SD1.5 for 512px, SDXL for 1024px
- Seed consistency: Lock seed when iterating on denoise/prompts
- Prompt the original: Include aspects you want to preserve
- Negative prompt matters: Be specific about what to avoid
Next Steps
- Learn Inpainting to edit specific regions
- Explore ControlNet for precise structural control
- Try combining img2img with LoRAs for enhanced results
- Experiment with different models optimized for specific tasks