TL;DR
Existing sketch-guided diffusion models face a dilemma: fine-grained adapters rigidly overfit to flawed, amateur sketches, while coarse-grained abstraction models cannot handle detailed, professional artwork. KnobGen introduces a dual-pathway framework combining a Coarse-Grained Controller (CGC) for semantic layout and a Fine-Grained Controller (FGC) for fine line adherence. Regulated by a training-time dynamic modulator and an inference-time "Knob," it allows users to smoothly dial between loose conceptual interpretation and strict edge fidelity.
What Problem Does This Paper Address?
Text prompts alone struggle to convey spatial layouts, prompting the rise of sketch-to-image conditioning tools like ControlNet and T2I-Adapter. However, these tools are tuned for high-fidelity edge maps: when given a rough, amateur doodle, they rigidly force artifacts, crooked lines, and unintentional flaws into the final render. Conversely, existing sketch-abstraction frameworks ignore text conditioning or support only a narrow set of object categories, failing to generalize to artistic, detailed sketches.
Currently, models sit at opposite extremes—either overly rigid (for experts) or excessively abstract (for novices)—with no unified way to balance spatial guidance against visual naturalness across different user skill levels.
Methods
KnobGen implements an add-on architecture for pre-trained Latent Diffusion Models (specifically Stable Diffusion v1.5):
- Dual-Pathway Architecture:
- Macro Pathway (Coarse-Grained Controller / CGC): Encodes both the sketch and text prompt using frozen CLIP encoders. An 8-layer cross-attention transformer fuses visual structure into text features, injecting high-level spatial semantics into the denoising U-Net layers without memorizing pixel-level edges.
- Micro Pathway (Fine-Grained Controller / FGC): Employs plug-and-play structural adapters (like ControlNet or T2I-Adapter) to inject low-level boundary and edge detail across diffusion stages.
- Dynamic Training Modulator: During training, the Micro Pathway's influence initially tends to overpower the Macro Pathway, leading to edge overfitting. A $\tanh$-based scheduling function regulates the Micro Pathway's weight ($m_t$), starting at a lower bound ($m_{\min} = 0.2$) and gradually ramping up to $1.0$ by later training epochs to let semantic layout stabilize first.
- Inference Knob ($\gamma$): Users set a threshold step $\gamma$ across the $S$ sampling steps (e.g., $S=50$). For steps $t \le \gamma$, both coarse and fine controllers guide generation; for $t > \gamma$, fine-grained edge injection is turned off, leaving only coarse semantic guidance. Dialing $\gamma$ low yields looser, smoothed outputs for amateur doodles, while setting $\gamma$ high forces tight geometric conformity for professional artwork.
Sketch + Text ---> [Macro: CLIP + Cross-Attention CGC] ---\
(+) ---> U-Net (Denoising)
Sketch ---------> [Micro: Pretrained FGC (e.g. CNet)] ---/
^
Modulated by tanh during training / Step threshold (γ) at inference
Datasets
- MultiGen-20M: A large-scale multi-modal conditioning dataset. The authors selected 20,000 images conditioned with Holistically-nested Edge Detection (HED) and applied binarization (threshold = 50) to simulate sketches for training.
- Evaluation Sets:
- Professional Benchmark: 500 edge-filtered images derived from MultiGen-20M representing seasoned artist sketches.
- Amateur Benchmark: A newly collected test set of 100 hand-drawn sketches created by non-professional users to test robustness against irregular geometries.
Key Insights and Ideas
- Decoupling Semantics from Contours: Conventional adapters directly inject multi-scale visual features into U-Net layers, inextricably linking semantics with exact edge placement. Fusing sketch tokens into text embeddings via cross-attention allows the model to absorb layout context without binding to line jitter.
- Early-Stage Feature Dominance: In joint training, detailed edge features converge faster than cross-modal semantic alignments. Progressively ramping adapter weight via a $\tanh$ schedule prevents edge cues from overshadowing high-level spatial planning early on.
- Temporal Detail Scheduling at Inference: Diffusion generates global layout during early steps and renders high-frequency details later. By terminating fine-grained feature injection after a threshold step $\gamma$, users can prevent the model from etching accidental hand tremors into the final texture.
Key Results
Evaluated on a diverse set of 600 sketches (using default $\gamma = 20, S = 50$):
| Model | CLIP Score ($\uparrow$) | FID ($\downarrow$) | Aesthetic Score ($\uparrow$) |
|---|---|---|---|
| ControlNet (CNet) | 0.3214 | 106.25 | 0.5182 |
| T2I-Adapter (T2I) | 0.3152 | 109.75 | 0.5093 |
| UniControl | 0.3210 | 95.30 | 0.5133 |
| ControlNet++ | 0.3204 | 99.51 | 0.5253 |
| KnobGen (KG-CN) | 0.3353 | 93.87 | 0.5349 |
| KnobGen (KG-T2I) | 0.3271 | 98.41 | 0.5208 |
- State-of-the-Art Quality: KnobGen with ControlNet (KG-CN) achieved the best CLIP alignment ($0.3353$), lowest FID ($93.87$), and highest aesthetic score ($0.5349$), outperforming baselines across both novice and expert inputs.
- Ablation Studies: Qualitative tests showed that training without the dynamic modulator resulted in degraded coarse spatial adherence, while testing the Knob mechanism on standard T2I-Adapter caused severe distortion when dialed to lower edge reliance.
Limitations and Future Work
- Empirical Tuning: Key hyperparameters—such as the modulator lower bound ($m_{\min} = 0.2$) and default knob cutoff ($\gamma = 20$)—were selected heuristically without exhaustive search.
- Diminishing Returns on Adapter Steps: The authors observed that in certain baselines (like T2I-Adapter), increasing the knob beyond a certain threshold yields negligible change, indicating complex temporal dynamics in conditional adapters that warrant further mathematical investigation.
- Model Size: Adding the CGC module introduces approximately 100M trainable parameters alongside existing diffusion adapters and base models.
Summary updated