ComfyUI image-to-image workflow: control denoise and detail
A useful ComfyUI image-to-image workflow starts with an existing picture, converts it to a latent image, and lets you control how much the diffusion model can redraw it. The difficult part is finding enough denoise to make the requested change without sacrificing the details you wanted to keep.
This tutorial provides an eight-node workflow, a fixed reference image and a five-setting comparison designed to locate that boundary. If you would rather generate or edit images in a browser, the DIY AI Image Generator offers a separate workflow, but it does not expose this local KSampler graph.
Download the minimal ComfyUI img2img workflow.
The accompanying ComfyUI image-to-image study kit contains an importable JSON graph, an original 512 x 512 reference JPG, a comparison CSV and a small pixel-difference checker. It uses eight standard nodes and no custom extensions. The kit also includes a separate API-format prompt for readers automating their own runs.
- Put the supplied
diyai-comfyui-img2img-source.jpgin ComfyUI’sinputdirectory, or select it through the Load Image node’s upload control. - Open
diyai-comfyui-img2img-denoise-workflow.jsonusing ComfyUI’s workflow Open action. This is the canvas graph; the separate API JSON is not a substitute. - Select
v1-5-pruned-emaonly-fp16.safetensorsin Load Checkpoint. You need that SD 1.5 checkpoint installed locally; the JSON does not contain model weights. - Check that the supplied source image is selected in Load Image and that the KSampler seed mode is fixed. Queue one image at the default 0.50 denoise; count this as the 0.50 trial.
- Run the four remaining denoise values in the study table below, saving a clearly named output after each run.
The checkpoint and input-image setup follows ComfyUI’s official image-to-image tutorial. This graph deliberately uses the conventional SD 1.5 checkpoint loader, not the model-specific node arrangements used by many newer editing models.
How the eight nodes connect
| Node | Connection | Job |
|---|---|---|
| Load Checkpoint | MODEL, CLIP and VAE outputs | Supplies the matching diffusion model, text encoder and autoencoder. |
| Load Image | IMAGE to VAE Encode | Provides the source pixels instead of a blank latent. |
| VAE Encode | LATENT to KSampler’s latent_image | Converts the input image into the model’s latent representation. |
| Two CLIP Text Encode nodes | CONDITIONING to positive and negative | Describe the requested image and unwanted features. |
| KSampler | LATENT to VAE Decode | Adds controlled noise and samples the edited latent. |
| VAE Decode | IMAGE to Save Image | Turns the latent result back into visible pixels. |
| Save Image | Final output | Writes each render into ComfyUI’s output directory. |
The important change from text-to-image is Load Image – VAE Encode – KSampler in place of Empty Latent Image. Denoising below 1.0 lets the input influence the result. At 1.0, standard img2img sampling effectively discards the original composition, even though the graph still contains the image input.
Run a controlled denoise comparison, not five different prompts
The reference image shows a red ceramic mug on an oak table, with a green apple, folded linen napkin and timber window behind it. The requested edit is narrow: make the mug cobalt blue while keeping its shape, handle, surrounding objects, viewpoint and lighting recognisable.
Use the same configuration for every run:
| Setting | Fixed value |
|---|---|
| Checkpoint | v1-5-pruned-emaonly-fp16.safetensors (SD 1.5) |
| Input | diyai-comfyui-img2img-source.jpg, 512 x 512 |
| Seed / mode | 42 / fixed |
| Steps / CFG | 24 / 7 |
| Sampler / scheduler | euler / normal |
| Prompt and negative prompt | Unchanged across all five runs; both are embedded in the JSON |
| Only variable | KSampler denoise |
The positive prompt describes a photorealistic still life with a cobalt-blue mug, right-facing handle, the same green apple and folded cream napkin, unchanged camera viewpoint and natural window light. Keep the complete embedded prompt rather than rewriting it between renders. Requesting an unchanged viewpoint is guidance, not a geometrical lock.
| Denoise | What this run tests | Inspect most closely |
|---|---|---|
| 0.20 | Whether subtle repainting is enough for any visible colour shift. | Does the mug remain red despite good shape preservation? |
| 0.35 | Whether a restrained edit starts obeying the new colour instruction. | Colour on the body and handle versus increased contrast alone. |
| 0.50 | Whether a stronger style and colour change can coexist with the original layout. | Mug silhouette, apple position, linen folds and window lines. |
| 0.65 | Whether better prompt compliance comes at the cost of reconstructing objects. | Handle geometry, contact shadows, fruit shape and reflections. |
| 0.80 | How much of the source scene survives a substantial redraw. | Composition drift, replaced details and invented edges. |
These rows are test questions, not measured outputs. The graph and fixed source are supplied so the comparison can be repeated, but the five SD 1.5 renders have not been executed for this article. The specific point where preservation becomes transformation must be established from the resulting files, not assigned from a universal denoise chart.
Find the first usable edit, not the prettiest redraw
Define acceptance before opening the output folder. The mug must visibly turn blue, its rim and handle should remain recognisable, and the apple, napkin and window must not acquire new shapes or positions. A render that looks more detailed but moves the apple has failed the preservation brief. A perfectly preserved red mug has failed the requested change.
Mark each of those checks separately in the accompanying CSV. The best setting is the lowest denoise that completes the colour change without unacceptable collateral edits, if any of the five settings does. There is no need to reward higher denoise simply because the result looks sharper at thumbnail size.
The kit’s Python helper measures mean absolute RGB pixel difference inside an approximate mug rectangle and outside it. An outside-region value of zero means identical RGB pixels in that comparison; a larger value means more pixel change. It is not a perceptual-quality score. A harmless lighting shift can raise it, while a distorted handle might occupy too few pixels to dominate the average. Use the metric to flag images for inspection, not to approve them automatically.
Separate VAE reconstruction drift from sampler changes
There is a control case that basic tutorials frequently miss. The input has to pass through the VAE before the sampler can edit it, and encoding then decoding may alter fine texture or colour slightly on its own. If you compare every output only with the original JPG, you can accidentally blame denoise for a difference introduced before sampling.
To establish a baseline, temporarily connect VAE Encode directly to VAE Decode, bypassing KSampler, and save that reconstructed image. Compare it with the source, then restore the sampler connection and run the five-setting study. The helper supports an optional --baseline image so you can compare each output against this reconstructed starting point instead. Keep both comparisons: source versus output tells you about total change, while VAE baseline versus output better isolates the sampler’s contribution.
Use the original output dimensions throughout. Resizing between trials introduces another uncontrolled change, and different model families can have different optimal image sizes and denoising behaviour.
Why a fixed seed cannot guarantee a successful colour change
A fixed seed makes the noise generation repeatable within the same environment and settings. It does not pin the object’s outline, guarantee identical pixels after a model update or force the prompt to override retained colour information. Changing denoise also changes the sampled noise schedule. The five outputs are a controlled parameter sweep, not five stages of one continuously edited image.
This issue is more than theoretical. In DIY AI’s local image generator guide, an earlier red-to-blue cabin experiment at 0.35 denoise completed but left the cabin red. The scene’s general structure survived while contrast increased. That is evidence for the cabin experiment only, not an invented result for this mug workflow. It illustrates why completion status and edit success need separate checks.
In practical img2img discussions, people repeatedly encounter the same trap: the lowest-denoise image can look pleasingly faithful while ignoring the requested edit, and higher values can solve the edit by changing unrelated details. Record both failures. Do not tune the prompt, seed, CFG and denoise simultaneously, or you will not know which adjustment helped.
See more of our reporting in Google Top Stories, AI Overviews and AI Mode.
Improve detail without destroying the reference.
If the mug becomes blue but the glaze turns noisy, first inspect the exact output at 100% zoom. Stronger sharpening in the prompt is not a substitute for a good source image. Increasing denoise again may redraw the apple, the mug’s handle or the window frame. Likewise, changing sampler and CFG during the denoise sweep would invalidate the comparison.
A sensible second pass starts only after selecting an acceptable first-pass render. Keep the accepted image as the new input, lower denoise for minor surface refinement and record it as a separate experiment. Do not count that two-pass output as one of the original five runs. Standard KSampler also does not automatically execute fewer sampling steps merely because denoise is lower; this study runs 24 steps at each setting.
There is a limit to what whole-image img2img can do. If you need the exact red mug recoloured while every other pixel remains untouched, a conventional colour adjustment is more deterministic. If the mug needs a new handle or one local area repaired, use masked inpainting rather than repeatedly regenerating the entire frame. For broader model choices, the AI image editing models comparison explains why edit success and preservation need separate assessment.
Diagnose a workflow failure before changing settings
| Symptom | Likely cause | First check |
|---|---|---|
| Checkpoint is missing or red | The named SD 1.5 file is absent or in another model directory. | Select an installed compatible checkpoint; confirm the correct ComfyUI model path. |
| Load Image fails | The source JPG has not been uploaded or copied into the input directory. | Choose the supplied file again in Load Image. |
| The same image appears five times | The denoise field did not change, or cached output was mistaken for a new render. | Check the KSampler value and ensure the saved filenames are distinct. |
| Objects keep shifting | Whole-image denoise is reconstructing more of the scene than the task can tolerate. | Try a lower denoise; switch to a local editing method if the target edit fails. |
| Colours drift but the edit fails | Low denoise preserves the old mug colour more strongly than the prompt changes it. | Review the next controlled denoise step before changing CFG or prompt wording. |
| The graph imports but cannot run | Checkpoint mismatch, model unavailable or a local-version difference. | Read the first red-node error and verify each core node; no custom nodes are required. |
Keep the graph simple until you know the preservation limit
Start with the supplied source, checkpoint, prompt and five KSampler values. Fill the study log with actual observations, including failed attempts, before adding upscalers, LoRAs or other controls. Only then decide whether a second-pass img2img refinement is worthwhile or whether the task needs a different editing method.
If the main constraint is convenience rather than a reproducible local node graph, DIY AI’s AI image generator comparison is a better place to choose a different tool. For ComfyUI, the result worth keeping is the first one that changes the intended detail while leaving the rest of the picture fit for use.

