Img2ImgTurboSketchRun
Scribble to finished image in one step, with a real randomness dial
- model
- image
- IMAGE
Img2ImgTurboSketchRun takes a rough sketch and a prompt and renders a finished image in a single denoising step. It's the "stochastic" member of the pack's sketch duo: same sketch, same prompt, different seeds give you different variations, and a gamma slider decides how far those variations are allowed to wander from your drawing. It's the closest this pack gets to a fun toy.
How it works
Under the hood it's CMU's img2img-turbo sketch-to-image model: an sd-turbo UNet with a twin-conv input layer that accepts the sketch as conditioning, plus LoRA adapters on the UNet and VAE. One UNet pass at timestep 999, straight to decoded RGB. No sampler, no CFG, no step count.
The input sketch gets binarized - everything darker than 50% gray becomes a line, everything lighter becomes background - and then resized to a multiple of 8. That's why clean, high-contrast sketches work best: midtone pencil shading gets flattened into either line or background, so a bold marker scribble beats a soft graphite one.
The inputs that matter
- model - the
Img2ImgTurboSketchModelfromImg2ImgTurboSketchLoader. - image - your sketch. The pack's painter workflow feeds it from a
PainterNode(draw in the UI, iterate live), and you can alsoLoadImagea scan. The base workflow usesFakeScribblePreprocessorto convert a photo into scribble-style lines first - handy if you want to work from a reference. - prompt - text that steers content. Empty works; "a woman's portrait" pushes the render toward that.
- seed - actually does something here. It seeds the noise that's blended into the latent, so it's your variation control: same sketch + prompt + seed + gamma = reproducible output.
- gamma - the star. Default 0.4. It interpolates the UNet input between the encoded sketch and pure noise, and scales the adapter weights too. Crank it toward 0 and the output gets more random and creative, drifting from your drawing. Push it toward 1 and it follows the sketch faithfully but produces near-identical results every time. Treat it as a faithfulness-vs-diversity dial and nudge it, don't just leave it.
Output
One IMAGE, already decoded to RGB. Wire it into PreviewImage or SaveImage - no extra VAE decode.
Installing
Part of the one-pack install. ComfyUI Manager → ComfyUI-Img2Img-Turbo, or:
cd ComfyUI/custom_nodes
git clone https://github.com/chaojie/ComfyUI-Img2Img-Turbo
pip install -r ComfyUI-Img2Img-Turbo/requirements.txt
Restart, then give the first run a few minutes while it downloads the base model and sketch LoRA.
Common issues
- Midtone sketches wash out. Because input is thresholded at 50% gray, soft pencil work turns into noise or blank space. Use bold, high-contrast lines.
- Unexpectedly different results across runs is usually gamma too low - that's the stochastic behavior doing its job, not a bug. Raise gamma toward 1 for determinism.
- Diffusers version drift is the pack's known weak spot: if another node upgraded it, re-pin with
pip install 'diffusers>=0.24.0,<=0.25.1'. - CUDA only - no CPU or MPS path, since
.cuda()is called unconditionally. - It's an SD-1.5-class model, so sketch sizes around 512–768 give the best quality; the demo painter workflow runs bigger but you'll trade sharpness.
For a live-drawing-to-image loop it's genuinely fun, and the gamma dial is the rare parameter that's both real and intuitive.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | Img2ImgTurboSketchModel | — | |
| image | IMAGE | — | |
| prompt | STRING | — | |
| seed | INT | 1234 | — |
| gamma | FLOAT | 0.40 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |