Image-to-Image Workflows

Intermediate 🕐 15 min Lesson 5 of 11
What you'll learn
  • Replace the Empty Latent Image node with Load Image and VAE Encode to build an image-to-image workflow.
  • Set the denoise parameter in KSampler to control how much the output differs from the input.
  • Apply image-to-image to three practical use cases: style transfer, sketch-to-image, and variation generation.

Starting from an Image Instead of Noise

Standard text-to-image starts from pure random noise. Image-to-image (img2img) starts from an existing photo, drawing, or generated image — partially encoding it into latent space and then running the diffusion process from that starting point instead of from blank noise. The result is a new image that inherits structure or content from the source while transforming it according to your prompt.

This opens up a completely different set of use cases: turning a rough photo into a painting, giving a sketch an illustrated finish, generating slight variations of an image you almost like, or using an upscaled image as input for a detail-enhancement pass.

The Node Change: Swapping Empty Latent Image

In a standard text-to-image workflow, the Empty Latent Image node creates blank latent space that the KSampler fills from scratch. For image-to-image, you replace it with two nodes:

  1. Load Image: loads your source image from disk or an upload. Right-click the node and select "Open Image" to browse files.
  2. VAE Encode: converts the pixel-space image into a latent representation that the KSampler can work with. Connect the Load Image output → VAE Encode → KSampler latent input.

The VAE Encode node needs the VAE to be connected to it. In most workflows, the VAE comes from your Load Checkpoint. Connect Load Checkpoint → VAE to VAE Encode → vae input.

Your text prompt and all other nodes remain exactly the same. Only the latent source changes from empty noise to encoded image.

The Denoise Parameter

With the latent source now set to your image instead of blank noise, the KSampler's denoise parameter controls how much that image is changed:

  • 1.0: completely ignores the source image and generates from scratch based on the prompt alone — effectively the same as text-to-image
  • 0.75: significant transformation; the output shares rough composition with the source but looks substantially different in detail and style
  • 0.5: balanced; same basic layout and major shapes, noticeably different style and fine detail
  • 0.3: conservative; keeps most of the source image intact, applies only subtle stylistic shifts and detail changes
  • 0.1: minimal; almost identical to the source image with very faint modifications

The right denoise level depends on what you want to achieve. There is no single correct value — run the same image at 0.3, 0.5, and 0.7 to see the range of outputs and pick the level that fits your goal.

Practical Use Cases

These are the three most common img2img applications you will actually use:

  • Photo to painting: Load a reference photograph. Set your prompt to describe the target art style (oil painting, watercolor, impressionist). Denoise at 0.6–0.75. The composition and subjects stay recognizable while the visual treatment transforms into the painted style. Use a style LoRA alongside for stronger stylistic pulls.
  • Sketch to finished image: Load a rough pencil sketch or digital drawing. Set your prompt to describe the finished scene. Denoise at 0.8–0.9. The AI uses your sketch's structure as a guide while filling in all the detail. This works well with ControlNet (Scribble or Canny mode) for tighter composition control.
  • Variation generation: Load a generated image you like. Keep the same (or slightly modified) prompt. Set denoise 0.4–0.55. Change the seed. Each run produces a variation that shares the composition of your source but differs in details, lighting, and fine-grained features. This is how you explore nearby possibilities in image space without regenerating from scratch.

Resolution and VRAM Considerations

The VAE Encode node does not resize your source image — it encodes it at its current resolution. If you load a 3000×2000 photo, the KSampler will run at that resolution, which may exceed your VRAM. Either resize the source image before loading it, or use a Resize node between Load Image and VAE Encode to bring it to a manageable resolution first (typically 768px on the long edge for SD 1.5, 1024px for SDXL).

For FLUX workflows, image-to-image uses the same node setup but pay close attention to resolution: FLUX encodes at a different latent scale and runs best at resolutions that are multiples of 64. Images at odd sizes may produce artifacts at the edges.

Key takeaways
  • Replace Empty Latent Image with Load Image plus VAE Encode to switch any workflow from text-to-image to image-to-image — the rest of the node graph does not change.
  • Denoise 1.0 ignores the source image completely, denoise 0.5 preserves major composition, and denoise 0.3 makes only subtle changes — the right value depends entirely on how much transformation you want.
  • For photo-to-painting transfers, use denoise 0.6–0.75 to transform the visual style while keeping the composition recognizable; for sketch-to-image, use 0.8–0.9 to let the AI fill in detail freely.
  • The VAE Encode node encodes your image at its current pixel resolution — resize large photos before loading them to avoid VRAM exhaustion during sampling.
  • Image-to-image variation generation is one of the most practical techniques for refining a good result — load a nearly-perfect image, lower denoise to 0.4–0.5, change the seed, and explore nearby variations without starting over.