Sampler for Style-Specific Text-to-Image
Text-to-image with attention distillation
- distiller
- style
- positive
- negative
- images
Don't let the plain node name fool you - this isn't a drop-in replacement for KSampler. ADSampler is the text-to-image half of ComfyUI-Attention-Distillation: you give it a text prompt like normal, but also a style reference image, and it generates fresh images from your prompt while pulling their visual character from that reference - no LoRA training, no style-specific checkpoint. It's the node behind the pack's "style-specific text-to-image generation" workflows (SD1.5 and SDXL are the tested paths; Flux is beta).
How it's different from a normal sampler
A regular KSampler runs a fixed denoising schedule and that's it - steps, CFG, sampler algorithm, done. ADSampler adds an inner optimization loop on top: notice it has both steps and lr (learning rate) and iters, which a standard sampler never needs. That's the same attention-distillation machinery as ADOptimizer, just steering a text-to-image generation toward a style reference instead of doing pure image-to-image transfer. It's slower than a plain KSampler pass for exactly that reason - you're getting style transfer folded into generation, not paying for generation alone.
Inputs that matter
distiller- from Load Distiller; picks the base model.style- theIMAGEwhose visual character you want the output to carry. Route it through Load PIL Image and Resize Image first.positive/negative-CONDITIONING, from two separate Text Prompt (PureText) nodes. This pack doesn't reuse ComfyUI's native CLIP Text Encode; use its own prompt node here.steps(default 50, up to 200) - the denoising step count, more in line with a normal sampler than ADOptimizer's 200+.lr(default 0.015) anditers(default 2, 0–5) - the style-optimization side: how strong each nudge is and how many optimization passes run. Pushitersup for a more thorough style match at a real time cost;0effectively turns the style-steering off.cfg(default 7.5) - classifier-free guidance, same concept as any SD1.5/SDXL sampler.num_images_per_prompt(default 1, up to 5) andseed(default 2025).height/width(default 512 each) - match these to yourstyleimage's resized dimensions.
Output is images (IMAGE).
Installing it
ComfyUI Manager - search "ComfyUI-Attention-Distillation" and install.
Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/zichongc/ComfyUI-Attention-Distillation
cd ComfyUI-Attention-Distillation
pip install -r requirements.txt
Restart ComfyUI, and get a diffusers-format model in place for Load Distiller first - see that node's page for the download details, since this isn't the usual single-file checkpoint drop.
Common issues
Style barely shows up in the output. Check iters before anything else - at 0 you're essentially just running text-to-image with no style steering at all. Bump it toward the upper end (up to 5) if the style reference isn't coming through, understanding that each increment costs generation time.
Output ignores the prompt entirely, or the style dominates everything. Make sure positive and negative are actually wired from two separate PureText nodes, not the same one or left on defaults - and that they're not accidentally swapped. If prompt-following genuinely still looks weak with correct wiring, cfg is the next dial, same as any SD1.5/SDXL workflow.
Generation is noticeably slower than a comparable KSampler run. Expected - you're paying for the iters/lr optimization loop on top of the steps denoising pass, not just the denoising pass alone. If speed matters more than a strong style match, lower iters first before cutting steps.
Flux results are inconsistent. The author flags Flux support as beta in the pack's changelog. Validate your prompt/style/settings combo on SD1.5 first if you're not sure whether an odd result is your settings or the model path.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| distiller | DISTILLER | — | |
| style | IMAGE | — | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| steps | INT | 501–200 | — |
| lr | FLOAT | 0.0150.001–1 | — |
| iters | INT | 20–5 | — |
| cfg | FLOAT | 7.501–20 | — |
| num_images_per_prompt | INT | 11–5 | — |
| seed | INT | 20250–18446744073709550000 | — |
| height | INT | 512256–4096 | — |
| width | INT | 512256–4096 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |