Paint by Example (advanced)
The same 2022 model, now with dials
- image
- mask
- example
- IMAGE
Same pipeline, more knobs
Simple got you results and you want control. Paint by Example (advanced) is the exact same Paint-by-Example pipeline with the training wheels off: everything the simple node takes, plus a guidance scale, a scheduler picker, a negative prompt, and the option to force an output size. If you've read the simple node's page, the shared bits - the auto-downloaded Fantasy-Studio model, the >5GB first run, the float16 load, the cuda/mps/cpu device pick - all still apply. What changes is what this node passes into the pipeline and what it does to the image before sampling.
The inputs that actually matter
The core stays the same: image, mask, example, seed, steps (default 30). Then:
- cfg - guidance scale, default 5. This is the dial for how hard the model tries to match the example's vibe. A bit above ~7 and colors start to oversaturate; 5 is a sane starting point and mostly where you'll leave it.
- sampler_name - and here's the trap: this is not ComfyUI's KSampler list. It's a list of diffusers schedulers -
pndm,euler,euler_ancestral,heun,dpmpp_sde,lms,ddpm,lcm,ipndm,ddim,uni_pc. The node hot-swaps the pipeline's scheduler to whichever you pick, so don't go hunting fordpmpp_2m- it isn't there. For a model this old the defaults are genuinely fine; pndm or ddim and move on. - negative - a real negative prompt (multiline, default empty). Probably the most useful addition here. "blurry, lowres, artifacts, oversaturated" does the usual job.
- resize - boolean, off by default. Flip it on to force width/height (default 512, multiples of 8) and pick a resize_mode:
bicubic,bilinear,lanczos,nearest,nearest-exact. It resizes both image and mask before inference. Handy when your source is an awkward shape - though 512 is about this model's comfort zone anyway, so upscaling after generation beats upscaling into it.
Output is a single IMAGE, exactly like the simple node.
The honest take
The dials don't lift the model's ceiling. The checkpoint is what it is - a 2022 exemplar inpainter that's rough around the edges and can wander from the example. What the extra inputs buy you is steering: a bit of negative prompt, a touch more guidance when it's being lazy, and a resize path for odd source resolutions. If your first output looks off, the fix is usually more steps or a slightly higher cfg - not sampler roulette.
Install and gotchas
Same as the rest of the pack. ComfyUI Manager, search "paint-by-example", or:
cd ComfyUI/custom_nodes
git clone https://github.com/phyblas/paint-by-example_comfyui
Restart after. Dependencies are diffusers, torch, torchvision. The two real failure modes to expect: the multi-gigabyte model download on first run, and the transformers incompatibility that the pack answers with pip install transformers==4.40.0 - a pin that can collide with other nodes wanting a newer transformers, so test it somewhere disposable before downgrading your main environment.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| example | IMAGE | — | |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 30 | — |
| cfg | FLOAT | 5.0 | — |
| sampler_name | COMBO | 11 options: pndm, euler, euler_ancestral, heun, dpmpp_sde, lms, +5 | |
| negative | STRING | — | |
| resize | BOOLEAN | false | — |
| width | INT | 512 | — |
| height | INT | 512 | — |
| resize_mode | COMBO | 5 options: bicubic, bilinear, lanczos, nearest, nearest-exact |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |