Nodes/Chaosaiart-Nodes/🔶 KSampler img2img
ComfyUI Node

🔶 KSampler img2img

Img2img, resize, and VAE decode in one node

By chaosaiart·Created 2 years ago·Updated about a year ago· 117
🔶 KSampler img2img
  • model
  • positive
  • negative
  • vae
  • image
  • IMAGE
◄Image_Mode▾►
◄Image_Size▾►
◄Img2img_input_Size▾►
â—„denoise1.00â–º
â—„seed0â–º
â—„steps20â–º
â—„cfg8.0â–º
◄sampler_name▾►
◄scheduler▾►
◄denoise_Override—►

This is the img2img sibling of Chaosaiart's txt2img KSampler: feed it a checkpoint, a prompt, and an image, and it handles the VAE encode, the resize-to-fit, the sampling, and the VAE decode back to pixels - no separate VAEEncode or VAEDecode nodes cluttering the graph.

What it does

The part that makes this genuinely more than a convenience wrapper is Img2img_input_Size, a three-way choice for what happens when your input image doesn't match your target size: resize stretches it to fit, crop cuts it down instead of distorting proportions, and override presumably skips the fitting step and uses the image's own dimensions directly. Target size itself comes from Image_Mode (Widescreen 16:9, Portrait 9:16, or Width = Height) crossed with Image_Size (360p, 480p, HD, Full HD) - the same aspect-ratio-then-tier pattern as the pack's Empty Latent Image node, just applied to an existing image instead of a blank one.

denoise (default 1, range 0–1) is your img2img strength - how much of the source image survives versus how much gets regenerated. At 1 you're basically doing txt2img with an image-shaped starting point; low values (0.3–0.6) keep the input recognizable and just restyle or refine it. The optional denoise_Override (FLOAT) lets you feed that value in dynamically from elsewhere in the graph instead of setting it as a fixed widget - handy if you're stepping denoise across an animation sequence and want a counter node driving it rather than a static slider.

Standard KSampler fields round it out: model, positive/negative, vae, image (required - this is the img2img input), seed, steps (default 20), cfg (default 8), sampler_name (34 choices), scheduler (9 choices). Output is just IMAGE - like the txt2img version, there's no LATENT output here, so if you need the raw latent downstream, KSampler3 is the one that gives it to you.

Why you'd reach for it

Same logic as its txt2img sibling: fewer nodes for a common pattern. It's especially useful if you're doing repeated img2img passes at a consistent target size - the Image_Mode/Image_Size dropdowns mean you're not retyping the same width/height on every instance, and the resize/crop/override choice handles mismatched source images without a separate resize node.

Installing it

Through ComfyUI Manager: search "Chaosaiart-Nodes," or "Install via Git URL" with https://github.com/chaosaiart/Chaosaiart-Nodes, then restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/chaosaiart/Chaosaiart-Nodes, restart ComfyUI. Linux needs pip install opencv-python and pip install tqdm (venv active first) for the pack as a whole to import without errors. Windows has a bundled Install_windows script. No model downloads - bring your own checkpoint and source images.

Troubleshooting

Getting an image back that barely resembles your input usually means denoise is too high - drop it toward 0.4–0.6 if you want the source to actually influence the result rather than get mostly regenerated. If the composition looks stretched or squashed, you probably want crop instead of resize on Img2img_input_Size, or vice versa if crop is cutting off content you needed. As with the txt2img version, cfg=8 by default is an SD 1.5/SDXL-flavored number - if you've loaded a distilled checkpoint, pull CFG down toward 1 or you'll get the same burned, oversaturated look people get from cranking CFG too high on any model. And because denoise and resolution both interact with how much detail survives, change one at a time rather than several settings at once if something looks off - otherwise you won't know which knob actually caused it.

Category🔶Chaosaiart/ksampler

Inputs (15)

NameTypeDefaultDescription
modelMODEL—
Image_ModeCOMBO3 options: Widht = Height, Widescreen / 16:9, Portrait (Smartphone) / 9:16
Image_SizeCOMBO4 options: 360p, 480p, HD, Full HD
Img2img_input_SizeCOMBO3 options: resize, crop, override
denoiseFLOAT1.000–1—
seedINT00–18446744073709550000—
stepsINT201–10000—
cfgFLOAT8.00–100—
sampler_nameCOMBO34 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +28
schedulerCOMBO9 options: normal, karras, exponential, sgm_uniform, simple, ddim_uniform, +3
positiveCONDITIONING—
negativeCONDITIONING—
vaeVAE—
imageIMAGE—
denoise_OverrideoptFLOAT—

Outputs (1)

NameTypeDescription
IMAGEIMAGE—