KnobGen: Controlling the Sophistication of Artwork in Sketch-Based Diffusion Models

## Abstract

Abstract Recent advances in diffusion models have significantly improved text-to-image (T2I) generation, but they often struggle to balance fine-grained precision with high-level control. Methods like ControlNet and T2I-Adapter excel at following sketches by seasoned artists but tend to be overly rigid, replicating unintentional flaws in sketches from novice users. Meanwhile, coarse-grained methods, such as sketch-based abstraction frameworks, offer more accessible input handling but lack the precise control needed for detailed, professional use. To address these limitations, we propose KnobGen , a dual-pathway framework that democratizes sketch-based image generation by seamlessly adapting to varying levels of sketch complexity and user skill. KnobGen uses a Coarse-Grained Controller (CGC) module for high-level semantics and a Fine-Grained Controller (FGC) module for detailed refinement.
The relative strength of these two modules can be adjusted through our knob inference mechanism to align with the user’s specific needs.
These mechanisms ensure that KnobGen can flexibly generate images from both novice sketches and those drawn by seasoned artists. This maintains control over the final output while preserving the natural appearance of the image, as evidenced on the MultiGen-20M dataset and a newly collected sketch dataset.

## 1 Introduction

Diffusion models (DMs) have revolutionized text-to-image (T2I) generation by generating visually rich images based on text prompts, excelling at capturing various levels of detail—from textures to high-level semantics (Saharia et al., ; Rombach et al., ; Nichol et al., ; Ramesh et al., ; Navard & Yilmaz, ). Despite their success, one of the primary limitations of these models is their inability to precisely convey spatial layout of the user-provided sketches. While text prompts can describe scenes, they struggle to capture complex spatial features, which makes it challenging to align generated images with user intent. This is particularly intensified when these users vary in skill and experience (Chowdhury et al., ; Song et al., ; Yang et al., ; Jiang et al., ).

To improve spatial control, sketch-conditioned DMs like ControlNet (Zhang et al., ), T2I-Adapter (Mou et al., ), and ControlNet++ (Li et al., ) have introduced mechanisms to allow users to input sketches that guide the generated image. However, these approaches primarily cater to artistic sketches with intricate details, which poses a challenge for novice users. When presented with rough sketches, these models rigidly align to unintentional flaws, producing results that misinterpret the user’s intent and fail to achieve the desired visual outcome. Furthermore, we observed that the quality and alignment of the generated images with the input sketch are highly sensitive to the weighting parameter that governs the model’s dependence on the condition, Figure 2.

Figure: Figure 2: Qualitative results demonstrating the impact of varying the weighting scheme in T2I-Adapter model. Lower weights result in images that poorly align with the input sketch in terms of spatial conformity, while higher weights improve spatial conformity of the generated image to the input sketch. However, higher weight compromises the natural appearance of the generated images.
Refer to caption: extracted/5919645/image_files/baseline_weights_1.jpg

In contrast, some frameworks like (Koley et al., )(^1^11The code and model weights at the time of submission were unavailable, preventing result reproduction.) have attempted to address the needs of novice users by introducing sketch abstraction. Although this democratizes the generation process,  Koley et al. () is limited to covering only 125 categories of sketch subjects and cannot handle unseen categories, significantly limiting the generalizability of the pre-trained DM to a limited number of subjects. Moreover, its abstraction-aware framework is not suitable for artistic-level sketches whose purpose is to guide the DM to follow a particular spatial layout. Additionally, the removal of the text-based conditioning in DM makes these models ignore the semantic power provided by text in diffusion models trained on large-scale image-text pairs. Additionally, it limits their ability to differentiate between visually similar but semantically distinct objects- such as zebra and horse.

In a nutshell, existing methods for sketch-based image generation tend to focus on either end of the user-level spectrum. Professional-oriented models like ControlNet and T2I-Adapter are designed to handle only artistic-grade sketches Fig. 3.a, while amateur-oriented approaches Koley et al. (), cater to novice sketches without text guidance Fig. 3.b. These methods often fail to integrate both fine-grained and coarse-grained control, limiting their adaptability across different user types and sketch complexities.

Figure: Figure 3: Comparison across various sketch-control in DM. (a) fine-grained control based method such as ControlNet or T2I-adapter rigidly resembles a novice sketch resulting in an unrealistic image (b) abstraction-aware frameworks such as Koley et al. () fails to capture fine grained-detials without text guidance(c) while our proposed KnobGen smoothes out the imperfection of the user drawing and preserves the features of the novice sketch. FGC: Fine-grained Controller, CGC: Coarse-grained Controller, ET: Text Encoder, EI: Image Encoder, DM: Diffusion Model.
Refer to caption: extracted/5919645/image_files/arch_design_flaw_1.jpg

To address these challenges, we propose KnobGen, a dual-pathway framework designed to empower a pre-trained DM with the capability to handle both professional and amateur-oriented approaches. KnobGen seamlessly integrates fine-grained and coarse-grained sketch control into a unified architecture, allowing it to adapt to varying levels of sketch complexity and user expertise. Our model is built on two key pathways, Macro Pathway and Micro Pathway. The Macro Pathway extracts the high-level visual and language semantics from the sketch image and the text prompt using CLIP encoders and injects them into the DM via our proposed Coarse-Grained Controller (CGC). The Micro Pathway injects low-level, detailed features and semantics directly from sketch through our Fine-Grained Controller (FGC) module.

Additionally, we propose two new approaches for training and inference in order to maintain a robust control of the Micro and Macro Pathways in the conditional generation. First, we introduce Modulator, a mechanism dynamically adjusting the influence of the FGC during training, ensuring that the CGC dominates in the early training phase to prevent overfitting to low-level sketch features extracted by the FGC module. This allows the model to optimally rely on both Pathways to capture high- and low-level spatial and semantic features. At inference, the Knob mechanism offers user-driven control during denoising steps, allowing adjustment of the level of fidelity between the generated image and the user’s inputs- sketch and text- by manipulating Micro and Macro Pathways. These new training and inference approaches ensure that KnobGen effectively handles not only novice sketches but also artistic-grade ones, adapting to varying levels of sketch complexity and user preferences.

Our key contributions are as follows:

- •
Dual-Pathway Framework for Sketch-Based Image Generation: KnobGen proposes an add-on framework to DMs that handles image generation flexibly for a broad spectrum of users, from novice to seasoned artists, through our proposed micro-macro path.
- •
Training Modulator for Balanced Coarse-Fine Grained Incorporation: Our dynamic modulator regulates the influence of our CGC and FGC modules throughout the training. This prevents premature overfitting to fine details, allowing the model to first capture high-level spatial coherence before gradually introducing more specific features.
- •
Inference Knob for Adaptive Image Generation: Our inference-time Knob mechanism allows users to control the level of fidelity between the generated image and the inputs, i.e. sketch image and text. Our Knob mechanism tweaks the level of abstraction and details of the generated image adaptively based on the user’s preference.

## 2 Related Work

### 2.1 Diffusion Models

Recent advances in DM have enabled high-quality image generation with improved sample diversity (Ho et al., ; Dhariwal & Nichol, ; Ho & Salimans, ; Nichol et al., ; Saharia et al., ; Shamshiri et al., ; Ramesh et al., ; Perera et al., ; Peebles & Xie, ), often exceeding the performance of Generative Adversarial Networks (GAN) (Goodfellow et al., ; Karras et al., ; ; Sauer et al., ). DMs are built on the concept of diffusion processes, where data are progressively corrupted by noise over several timesteps. The models learn to reverse this process by iteratively denoising noisy samples, transforming pure noise back into the original data distribution. Several studies, such as DDIM (Song et al., ), DPM-solver (Lu et al., ), and Progressive Distillation (Salimans & Ho, ), have focused on accelerating DMs’ generation process through more efficient sampling methodologies. To address the high computational costs of training and sampling, recent research has successfully employed strategies to project the original data into a lower-dimensional manifold, with DMs being trained within this latent space. Representative methods include LSGM (Vahdat et al., ), LDM (Rombach et al., ), and DALLE-2 (Ramesh et al., ), all of which leverage this latent space approach to improve efficiency while maintaining high generation quality.

Figure: Figure 4: KnobGen vs. baseline on novice sketches. KnobGen handles amateurish sketches by injecting features from the Micro and Macro Pathways in a controlled manner. Dual pathway design ensures that the generated image is faithful to the spatial layout of the original input sketch and the image has a natural appearance. Baseline methods, however, exhibit difficulty in maintaining these desired properties in their generations.
Refer to caption: extracted/5919645/image_files/knobgen_results_weakness_1.jpg

### 2.2 Text-to-Image Diffusion

In addition to producing high-quality and diverse samples, DMs offer superior controllability, especially when guided by textual prompts (Rombach et al., ; Xue et al., ; Chen et al., ; Podell et al., ; Esser et al., ). Imagen (Saharia et al., ) employs a pretrained large language model (e.g., T5 (Raffel et al., )) and a cascade architecture to achieve high-resolution, photorealistic image generation. LDM (Rombach et al., ), also known as Stable Diffusion (SD), performs the diffusion process in the latent space with textual information injected into the underlying UNet through a cross-attention mechanism, allowing for reduced computational complexity and improved generation fidelity. To further address challenges when handling complex text prompts with multiple objects and object-attribution bindings, RPG (Yang et al., ) proposed a training-free framework that harnesses the chain-of-thought reasoning capabilities of multimodal large language models (LLMs) to enhance the compositionality of T2I generation. Ranni (Feng et al., ) tackles this problem by introducing a semantic panel that serves as an intermediary between text prompts and images; an LLM is finetuned to generate semantic panels from text which are then embedded and injected into the DM for direct composition. Our proposed method aligns with the SD paradigm but diverges by incorporating a composite module that combines textual information with coarse-grained information from sketch inputs, thereby injecting more comprehensive high-level semantics into the diffusion model.

### 2.3 Conditional Diffusion with Semantic Maps

As textual prompts often lack the ability to convey detailed information, recent research has explored conditioning DMs on more complex or fine-grained semantic maps, such as sketches, depth maps, normal maps, etc. Works such as T2I-Adapter (Mou et al., ), ControlNet (Zhang et al., ), and SCEdit (Jiang et al., ), leverage pretrained T2I models but employ different mechanisms to interpret and integrate these detailed conditions into the diffusion process. UniControl (Qin et al., ) proposes a task-aware module to unify $N$ different conditions (i.e. $N=9$) in a single network, achieving promising multi-condition generation with significantly fewer model parameters compared to a multi-ControlNet approach.
While Koley et al. () attempts to democratize sketch-based diffusion models, their approach faces several significant limitations, as discussed in the Introduction section. In contrast, our dual-pathway method integrates both fine-grained and coarse-grained sketch conditions while maintaining the option for textual prompts. This design offers greater flexibility and control, accommodating users ranging from amateurs to professionals.

## 3 Method

### 3.1 Preliminary

##### Stable Diffusion

Diffusion models (Ho et al., ) define a generative process by gradually adding noise to input data $z_{0}$ through a Markovian forward diffusion process $q(z_{t}|z_{0})$. At each timestep $t$, noise is introduced into the data as follows:

$$ $z_{t}=\sqrt{\bar{\alpha}_{t}}z_{0}+\sqrt{1-\bar{\alpha}_{t}}\epsilon,\quad \epsilon\sim\mathcal{N}(\mathbf{0},\mathbf{I}),$ (1) $$

where $\epsilon$ is sampled from a standard Gaussian distribution, and $\bar{\alpha}_{t}=\prod_{s=0}^{t}\alpha_{s}$, with $\alpha_{t}=1-\beta_{t}$ representing a differentiable function of the timestep $t$. The diffusion process gradually converts $z_{0}$ into pure Gaussian noise $z_{T}$ over time.

The training objective for diffusion models is to learn a denoising network $\epsilon_{\theta}$ that predicts the added noise $\epsilon$ at each timestep $t$. The loss function, commonly referred to as the denoising score matching objective, is expressed as:

$$ $\mathcal{L}(\epsilon_{\theta})=\sum_{t=1}^{T}\mathbb{E}_{z_{0}\sim q(z_{0}), \epsilon\sim\mathcal{N}(\mathbf{0},\mathbf{I})}\left[\|\epsilon_{\theta}(\sqrt {\bar{\alpha}_{t}}z_{0}+\sqrt{1-\bar{\alpha}_{t}}\epsilon)-\epsilon\|_{2}^{2} \right].$ (2) $$

In controllable generation tasks (Zhang et al., ; Mou et al., ), where both image condition $c_{v}$ and text prompt $c_{t}$ are provided, the diffusion loss function can be extended to include these conditioning inputs. The loss at timestep $t$ is modified as:

$$ $\mathcal{L}_{\text{train}}=\mathbb{E}_{z_{0},t,c_{t},c_{v},\epsilon\sim \mathcal{N}(0,1)}\left[\|\epsilon_{\theta}(z_{t},t,c_{t},c_{v})-\epsilon\|_{2} ^{2}\right],$ (3) $$

where $c_{v}$ and $c_{t}$ represent the visual and textual conditioning inputs, respectively.

During inference, given an initial noise vector $z_{T}\sim\mathcal{N}(\mathbf{0},\mathbf{I})$, the final image $x_{0}$ is recovered through a step-by-step denoising process (Ho et al., ), where the denoised estimate at each step $t$ is calculated as:

$$ $z_{t-1}=\frac{1}{\sqrt{\alpha_{t}}}\left(z_{t}-\frac{1-\alpha_{t}}{\sqrt{1- \bar{\alpha}_{t}}}\epsilon_{\theta}(z_{t},t,c_{t},c_{v})\right)+\sigma_{t}\epsilon,$ (4) $$

with $\epsilon_{\theta}$ being the noise predicted by the U-Net (Ronneberger et al., ) at timestep $t$, and $\sigma_{t}=\frac{1-\bar{\alpha}_{t-1}}{1-\bar{\alpha}_{t}}\beta_{t}$ representing the variance of the posterior Gaussian distribution $p_{\theta}(z_{0})$. This iterative process gradually refines $z_{t}$ until it converges to the denoised image $z_{0}$.

### 3.2 Dual Pathway

Our model introduces a dual-pathway framework that harmonizes high-level semantic abstraction with precise, low-level control over visual details, Figure 5. The integration of the CGC module and FGC module enables KnobGen to adaptively inject high-level semantics and low-level features throughout the denoising process. This design ensures that the model can scale its output complexity based on user input, thus supporting a wide spectrum of sketch sophistication levels, from amateur to professional-grade sketches.

#### 3.2.1 Macro Pathway

Diffusion models typically rely on text-based conditioning using CLIP text encoders (Radford et al., ) to capture high-level semantics (Ramesh et al., ; Saharia et al., ; Nichol et al., ), but this approach often misses out on structural cues inherent to other modalities, such as sketches. Although models such as CLIP (Radford et al., ) encode visual features and textual semantics, they remain biased toward coarse-grained features (Bianchi et al., ; Wang et al., ). In our CGC module, Figure 5.B, we used this fact to our advantage to fuse a high-level visual and linguistic understanding to control DM generation by incorporating both text and image embeddings through a cross-attention mechanisms.

Figure: Figure 5: Overview of KnobGen during training and inference. A illustrates the training process, where the CGC and FGC modules are dynamically balanced by the modulator. B expands on the CGC module, detailing how high-level semantics from both text and image inputs are integrated. C shows the inference process, including the knob mechanism that allows user-driven control over the level of fine-grained detail in the final image.
Refer to caption: extracted/5919645/image_files/HEDFusion.jpg

##### Coarse-grained Controller (CGC):

In our CGC module, we leverage the trained CLIP text encoder and its corresponding image encoder variant available in the pretrained Stable Diffusion Model (Rombach et al., ). Our CGC module first takes the raw sketch image (condition) and prompt as input. Using the CLIP image and text encoders, the CGC module first projects them into $x_{i}\in\mathbb{R}^{256\times 1024}$ and $x_{p}\in\mathbb{R}^{77\times 768}$ which are the image and text embeddings. A cross-attention mechanism then fuses these embeddings to produce a multimodal representation that combines textual semantics and visual cues, Figure 5.B. This enables the diffusion process to encode the high-level semantics from text while explicitly integrating spatial features from the sketch using the Clip image encoder. The cross-attended embeddings are injected into layers of the denoising U-Net to preserve the coarse-grained visual-textual features throughout the diffusion process. Detailed discussion of the CGC module can be found in the Appendix B.

#### 3.2.2 Micro Pathway

For artistic users, preserving fine-grained details such as object boundaries and textures is essential. The Fine-Grained Controller (FGC) is designed to address these requirements by integrating pretrained modules such as ControlNet (Zhang et al., ) and the T2I-Adapter (Mou et al., ), which excel in capturing these intricate features. Our Micro Pathway can utilize any pretrained fine-grained controller module which shows the flexibility of our proposed framework.

Incorporating these modules into our micro pathway allows the model to capture detailed, sketch-based features at multiple denoising stages. This pathway complements the coarse-grained features extracted by the CGC module, ensuring that the model not only preserves high-level semantic coherence, but also maintains visual fidelity and spatial accuracy with respect to sketch. Additionally, the FGC module ensures that the model handles professional-grade sketches with precision.

### 3.3 Modulator at training

One of the key innovations in KnobGen is the tanh-based modulator, which regulates the contributions of the micro and macro pathways during training, Fig 5.A. Based on our experiments in section 4.4, the incorporation of micro pathway in the early epochs of training process overshadows the effect of our macro pathway. Not only does this phenomenon lead to a model that overfits low-level features of the sketch, but it also prevents the model from generalizing to broader spatial and conceptual features. To mitigate this, we employ a modulator that progressively increases the impact of the Micro Pathway, i.e. the FGC module, during training. The modulator is based on a smooth tanh function:

$$ $m_{t}=m_{\text{min}}+\frac{1}{2}\left(1+\tanh(\underbrace{k\cdot\frac{t}{T}-3} _{\text{$\psi$}})\right)\cdot(m_{\text{max}}-m_{\text{min}})$ (5) $$

Here, $t$ is the current epoch, $T$ is the total number of epochs of training, $k=6$, $\psi\in[-3,3]$, $m_{\text{min}}=0.2$ and $m_{\text{max}}=1$ where $m_{\text{min}}$ and $m_{\text{max}}$ define the range within which the modulator effect (in percent), i.e. $m_{t}$, will vary over the course of the epochs. In order to choose $m_{\text{min}}$, we heuristically found that the maximum lower bound for negligible effect of the FGC is at $m_{\text{min}}=0.2$. We did not conduct an extensive hyperparameter search for $m_{\text{min}}$ and only chose this value based on our observation of different case studies, Figure 2. As seen in Figure 5.A, the module ensures that diffusion is more affected by the Macro Pathway and less by the Micro Pathway in the early stages of training. As the training progresses, $m_{t}$ for the Micro Pathway approaches 1 and as a result our FGC module will have an equal impact in the training as that of the CGC. By gradually modulating the influence of the Micro Pathway, we prevent the premature weakening of high-level spatial layout presented by the Macro Pathway, and ensure that both pathways contribute optimally throughout the training process. The effectiveness of our modulator is experimented in section 4.4.

### 3.4 Inference Knob

In typical diffusion models, the early denoising steps during inference focus on generating high-level spatial features, while the later steps refine finer details (Ho et al., ; Meng et al., ). In our dual-pathway model, this mechanism is explicitly implemented by our proposed inference-time Knob. This is essentially a user-controlled tool that determines the range of how much abstraction or rigid alignment with respect to the input sketch is desired by the user, Fig 5.C.

We introduce $\gamma$ variable as our Knob parameter. Let the total number of denoising steps be $S$, and $\gamma$ represent the step at which fine-grained details cease to influence the denoising process. The inference knob influnce the impact of the CGC and FGC modules at inference-time, allowing users to adjust $\gamma$ depending on their desired level of detail:

$$ $f_{\ell}(t)=\begin{cases}f_{\text{coarse}}(t)+f_{\text{fine}}(t),&\text{if }t \leq\gamma,\\ f_{\text{coarse}}(t),&\text{if }t>\gamma,\end{cases}\quad\forall\,\ell\in\{ \textit{U-Net\ layers\}},$ $$

In this equation, $t$ represents the current denoising step during the inference. The parameter $\gamma$ acts as the knob value, determining the threshold at which the injection of fine-grained features ceases. When the denoising step $t$ is less than or equal to $\gamma$, both coarse-grained features $f_{\text{coarse}}(t)$ and fine-grained features $f_{\text{fine}}(t)$, generated by the macro and micro pathways respectively, are injected into the U-Net across layers, denoted by $\ell$. However, when $t$ exceeds $\gamma$, only the coarse-grained features $f_{\text{coarse}}(t)$ are injected into the U-Net.

A lower $\gamma$ value results in more abstract outputs with respect to the original input sketch, while a higher value makes the model produce images that closely match the sketch’s finer details. This adaptive control allows KnobGen to accommodate a wide range of user preferences and input complexities, ensuring that both novice and artists can generate images that align with their expectations, Figure 6. The effectiveness of our proposed Knob mechanism is illustrated in Appendix( C.2).

## 4 Experiment

We conducted several qualitative and quantitative experiments to validate the effectiveness of KnobGen. The qualitative experiments showcase the effectiveness of our approach in guiding the DM based across different sketch complexities. The qualitative experiments evaluate our model against widely-used baselines on different generation metrics such as CLIP and FID scores. We used pretrained ControlNet and T2I-Adapter as our FGC module throught all our experimentation. According to the parameters defined in section 3.4, $\gamma=20$ and $S$ = 50. These values were heuristically selected and were used consistently in all experiments and baselines.

The extension of the qualitative experiments is available in the Appendix (C). Furthermore, details about the setup used in the training and evaluation are discussed at length in the Appendix (A).

Figure: Figure 6: Impact of the knob mechanism across varying sketch complexities. From top to bottom, the sketches increase in complexity. The horizontal color spectrum represents the knob values, with light blue on the left ($\gamma$=20) indicating minimal reliance on the sketch, and dark blue on the right ($\gamma$=50) representing maximal reliance.
Refer to caption: extracted/5919645/image_files/knob_spectrum.jpg

### 4.1 Qualitative Results

Our qualitative results demonstrate the flexibility and effectiveness of KnobGen in handling varying sketch qualities. As shown in Figure 1, KnobGen is able to seamlessly adapt to sketches from rough amateur drawings to refined professional ones, highlighting its ability to cover the entire spectrum of user expertise. Figure 6 illustrates the impact of our knob mechanism, where increasing the knob value (left to right) progressively improves the fidelity to the sketch input. This dynamic adjustment enables precise control over the level of detail, allowing users to fine-tune generation outputs. More qualitative results are provided in the Appendix (C.2).

### 4.2 Comparison vs. baselines

In order to conduct a fair comparative study, we evaluated KnobGen against baselines such as (Mou et al., ; Li et al., ; Zhang et al., ) on professional-grade sketches, novice ones and a spectrum in between. Figure 4 illustrates the superior quality of the novice-based sketch conditioning using our method against all the other baselines. KnobGen not only captures the spatial layout of the input sketch thanks to the CGC module but also extends beyond it by generating fine-grained details through the FGC module which ultimately produces a naturally appealing images. Whereas the baselines either rigidly conditions themselves on the imperfect input sketch or does not follow the spatial layout desired by the user.

**Table 1: Comparison of various models on CLIP score (higher is better), FID score (lower is better), and Aesthetic score (higher is better). The models include ControlNet (CNet), T2I-Adapter (T2I), UniControl (UC), ControlNet++ (CNet++), AnimateDiff (ADiff), KnobGen with ControlNet as the Fine-Grained Controller (KG-CN), and KnobGen with T2I-Adapter as the Fine-Grained Controller (KG-T2I). KnobGen variants (KG-CN and KG-T2I) consistently outperform other models. The number of sketches used for the evaluation is 600.**
| Models | CNet | T2I | UC | CNet++ | ADiff | KG-CN | KG-T2I |
| --- | --- | --- | --- | --- | --- | --- | --- |
| CLIP $\uparrow$ | 0.3214 | 0.3152 | 0.3210 | 0.3204 | 0.2988 | 0.3353 | \ul0.3271 |
| FID $\downarrow$ | 106.25 | 109.75 | \ul95.30 | 99.51 | 119.01 | 93.87 | 98.41 |
| Aesthetic $\uparrow$ | 0.5182 | 0.5093 | 0.5133 | \ul0.5253 | 0.4751 | 0.5349 | 0.5208 |

### 4.3 Quantitative Results

Table 1 provides a quantitative comparison between state-of-the-art DM models and KnobGen. We evaluated our model with two different FGC module plugins, that is, ControlNet and T2I-Adapter. We call our KnobGen whose FGC module is ControlNet KG-CN and with the T2I-Adapter KG-T2I. We measure performance using the CLIP score (prompt-image alignment), Fréchet Inception Distance (FID) and Aesthetic score (for more information, see Appendix A). KG-CN achieves the highest CLIP score of 0.3353, surpassing the best baseline of 0.3214. KG-CN also gives the lowest FID score (93.87) and the highest aesthetic score (0.5349), demonstrating superior image quality and realism. We use a stratified sampling method based on pixel count to evaluate professional and amateur sketches, ensuring robustness across varying complexity levels. Our results demonstrate KnobGen’s effectiveness in generating high-quality images, regardless of input skill level.

Figure: Figure 7: Comparative results showcasing the impact of the Modulator in the training process. The top side of the figure displays results generated by the model trained without the Modulator, while the bottom part illustrates outputs from the model trained with the Modulator.
Refer to caption: extracted/5919645/image_files/konb_gen_modulator_with_without_1.jpg

### 4.4 Ablation Study

One of the key innovations in our methodology is the introduction of the Modulator, a mechanism designed to enhance the training process of our proposed CGC module. We conducted an experiment where we trained two versions of KnobGen with Modulator and without it. To assess the effectiveness of the Modulator at the inference, we excluded the FGC module after 20 denoising steps in the image generation process ($S$ = 50, and $\gamma=20$, please refer to section 3.4). Excluding the FGC module imposes the conditioning of DM to be done by the CGC module. This experimental configuration demonstrates the power of our CGC module.

Figure 7. presents the results of these experiments, showcasing images generated with and without the Modulator. The comparative analysis reveals that the model trained with the Modulator exhibits a significantly enhanced ability to integrate sketch-based coarse-grained guidance into the image generation process. This indicates that the Modulator not only improves the model’s overall performance but also ensures that the CGC’s influence is effectively optimized during training, resulting in higher-quality, more accurate image synthesis.

## 5 Conclusion

In this paper, we presented KnobGen, a dual-pathway framework designed to address the limitations of existing sketch-based diffusion models by providing flexible control over both fine-grained and coarse-grained features. Unlike previous methods that focus on detailed precision or broad abstraction, KnobGen leverages both pathways to achieve a balanced integration of high-level semantic understanding and low-level visual details. Our novel modulator dynamically governs the interaction between these pathways during training, preventing over-reliance on fine-grained information and ensuring that coarse-grained features are well-established. Additionally, our inference knob mechanism offers user-friendly control over the level of professionalism in the final generated image, allowing the model to adapt to a spectrum of sketching abilities—from amateur to professional. By incorporating these mechanisms, KnobGen effectively bridges the gap between user’s input and model robustness. Our approach sets a new standard for sketch-based image generation, balancing precision and abstraction in a unified, adaptable framework.

#### Reproducibility Statement

Our experiment setups are concisely described in Section 4, with additional implementation details provided in Appendix Sections A and B. We will make our code publicly available to facilitate the reproduction of our results upon acceptance of this paper.

## Appendix

In this appendix, we provide additional details about the model architecture and supplementary results that further demonstrate the robustness of our approach. These sections aim to provide a deeper understanding of the technical components and showcase more comprehensive comparisons.

- •
Appendix A: details the setup of training and evaluation in KnobGen.
- •
Appendix B: expands on the details of the proposed CGC module.
- •
Appendix C: provides more qualitative results.

## Appendix A Setup

##### Dataset:

We utilized the MultiGen-20M dataset, as introduced by Qin et al. (), to train and evaluate our model. The dataset offers various conditions, making it a suitable choice for our approach. We selected 20,000 images for training, focusing specifically on those with the Holistically-nested Edge Detection (HED) (Xie & Tu, ) condition. However, we modified the KnobGen condition by applying a thresholding technique, where pixels below a threshold value of 50 were set to zero, and those above were set to one. This threshold value was chosen through simple visual comparisons of several samples using different thresholds, allowing us to identify the most effective value. This modification essentially transforms the HED condition into a sketch. For evaluation, we curated two distinct sets of images. The first evaluation set consisted of 500 randomly selected samples, which are similar to a sketch drawn by a seasoned artist (we followed the thresholding technique for this part), allowing us to measure our model’s effectiveness in professional settings. To further test the robustness and adaptability of our approach, we compiled a second evaluation set of 100 hand-drawn images created by non-professional individuals. This diverse testing set enabled us to demonstrate the model’s ability to generalize across a broad spectrum of users, ensuring it can handle both professionally designed and amateur drawings with high robustness.

##### Baselines:

In this work, we evaluate the performance of our proposed model against several state-of-the-art (SOTA) diffusion-based models. Specifically, we conduct both qualitative and quantitative comparisons with prominent models such as ControlNet (Zhang et al., ), T2I-Adapter (Mou et al., ), AnimateDiff (Guo et al., ), UniControl (Qin et al., ), and ControlNet++ (Li et al., ). These models have achieved significant advances in fine-grained control of image generation by incorporating sketch-based conditions into the diffusion process. Since AnimateDiff is a video-based DM, we only use the first frame of the generated video by it as the comparison point.

##### Evaluation:

We perform qualitative and quantitative evaluation. In the qualitative evaluation, we compare our model’s performance across different scenarios of varying input conditions and complexities. For quantitative evaluation, we utilize several metrics to assess the quality of the generated images. First, we calculate the Fréchet Inception Distance (FID) (Heusel et al., ; Karras et al., ), which measures the similarity between generated and natural images using a pre-trained InceptionV3 model (Szegedy et al., ). Lower FID values indicate better generation quality; we used Hukkelås () implementation for our evaluation, which used the default pre-trained InceptionV3 model available in Pytorch (Paszke et al., ). To evaluate the alignment between the generated images and the text prompts, we use CLIP (Radford et al., ), specifically the pre-trained DetailCLIP model (Monsefi et al., ) with a Vision Transformer (ViT-B/16) backbone. Higher CLIP scores signify better alignment between the generated images and their corresponding prompts. Finally, we assess the realism and aesthetic quality of the generated images using the metric proposed by (Ke et al., ), where higher scores reflect more realistic and visually appealing images.

##### Implementation Details:

Our proposed KnobGen framework is built on top of Stable Diffusion v1.5 (Rombach et al., ), with the original parameters kept frozen throughout training. For the Fine-Grained Controller (FGC) module, we employed two different pre-trained models to demonstrate the flexibility and effectiveness of our approach across multiple setups. Specifically, we integrated ControlNet (Zhang et al., ) and T2I-Adapter (Mou et al., ), both of which had their parameters frozen and were not updated during training. The architecture and integration of these components are illustrated in Figure 5. We trained the CGC module for a total of $2000$ epochs using 16 A100 GPUs. During the initial $1500$ epochs, we employed the modulator mechanism, as described in Section 3.3, with a learning rate of $1e-5$. In the final $500$ epochs, we fine-tuned the CGC model with a reduced learning rate of $1e-6$ to ensure robustness and to improve the quality of the generated images.

## Appendix B Model architecture

The CFC module plays a critical role in our model by integrating and aligning visual and textual information for effective image generation. The primary goal of the CFC is to ensure that features derived from both the input sketch image and the text prompt are jointly fused, allowing the model to generate more contextually relevant and visually coherent outputs. The CFC module has around 100M trainable parameters.

Figure: Figure 8: Overview of the Cross-Feature Conditioning (CFC) module. The module integrates visual and textual features through a series of transformer blocks with cross-attention. In the diagram, $X_{i}$ represents the encoded image features from a sketch, while $X_{p}$ denotes the encoded text prompt. The CFC module conditions the text features based on the image input, allowing for fine-grained control and alignment between visual and textual inputs during the image generation process.
Refer to caption: extracted/5919645/image_files/CFC.png

To achieve this, we designed the CFC module using a transformer-based architecture that leverages cross-attention between image and text features; Figure 8 shows the CFC overview. Below, we explain the architecture and functionality in detail:

##### Architecture:

The CFC module is composed of three key components: convolutional layers for feature transformation, transformer layers for cross-attention, and fully connected layers for output projection. The module takes two inputs—visual features (encoded input image) and text features (encoded text prompt)—and processes them jointly to output contextually conditioned text features.

- •
1D Convolutional Layers: The input to the CFC module consists of two tensors: an encoded image tensor $x_{i}\in\mathbb{R}^{\text{batch}\times 256\times 1024}$, which comes from CLIP image encoder, and an encoded text tensor $x_{p}\in\mathbb{R}^{\text{batch}\times 77\times 768}$, which comes from text encoder of CLIP like all the prompt conditioned DM. We then pass these embeddings through 1D convolutional layers to project the input channels (1024 for images and 768 for text) into a common hidden dimension of 1024 channels. This transformation ensures that both modalities can be effectively combined in the cross-attention mechanism.
- •
Transformer Layers for Cross-Attention: The core of the CFC module lies in its eight layers of transformers that perform cross-attention. These layers allow the model to fuse information from both the image and text features. Specifically, the image tensor serves as the memory input for the transformer, while the text tensor undergoes cross-attention, attending to the visual information. This design enables the model to enhance text-based features by conditioning them on the spatial and structural content of the image. The resulting enriched text features better capture the contextual relevance of the image, leading to more semantically meaningful generation.
- •
Fully Connected Layers: After passing through the transformer layers, the output text tensor is reduced back to its original sequence length (77 tokens) and further processed through two fully connected layers. These layers refine the text features, ensuring that the final output has the desired dimensionality (batch, 77, 768) and captures the relevant information for conditioning the image generation process.

##### Reasoning Behind the Design:

The CFC module is specifically designed to address the need for strong alignment between visual and textual inputs during image generation. By using a cross-attention mechanism, the module ensures that the text features are not treated independently of the visual content, but rather, are conditioned on the image’s features as well. This approach is particularly useful when fine-grained control is needed to generate images that aligns to both the textual description and visual input, making it highly effective in scenarios where accurate text-to-image alignment is crucial. Additionally, the use of pre-trained models ensures that the model benefits from robust initial feature extraction which further improves generation quality as a result.

## Appendix C More Qualitative Result

This section contains more qualitative results to complement the evaluations presented in the main paper. We provide visual examples of different use cases, including scenarios involving amateur and professional sketches.

### C.1 Inference Knob Mechanism For Baselines

One of the important ablation studies was to evaluate the performance of fine-grained controller models, such as the T2I-Adapter, when they utilize our Knob mechanism. This ablation study was particularly performed to demonstrate the effectiveness of our proposed CGC module.

Models such as T2I-Adapter are traditionally designed for precise, detail-oriented image generation but lack the flexibility to accommodate broader, more abstract inputs like rough sketches or varying user skills. To explore this issue, we integrated the Knob system into the T2I-Adapter model without our CGC module.

Figure: Figure 9: Effect of the Knob mechanism on the fine-grained models (T2I-Adapter). The image demonstrates how increasing the Knob value influences the generated output. While the T2I-Adapter performs well with precise, detailed sketches, it struggles with rougher sketches and fails to maintain spatial consistency as the Knob value increases. Beyond a certain threshold, the sketch has minimal impact on the final output, highlighting the model’s sensitivity to early-stage adjustments and its limitations in handling coarse-grained information.
Refer to caption: extracted/5919645/image_files/t2i_adapter_knob_spectrum_1.jpg

Figure 9 showed that while the T2I-Adapter performs exceptionally well in generating high-fidelity images from professional-grade inputs, it struggles to maintain this quality when dealing with rougher or less detailed sketches. This limitation arises from the absence of a Macro Pathway in the T2I-Adapter’s architecture, which makes the model overly reliant on precise input details. Without the ability to capture broader, high-level semantic information through a coarse-grained approach, the model becomes highly sensitive to adjustments made by the Knob mechanism. As a result, T2I-Adapter fails to deliver consistently good results across a diverse range of users, particularly those providing amateur or less-defined sketches. Additionally, we observed that after a certain point, increasing the Knob value no longer meaningfully affects the generation output. This suggests that the sketch condition in T2I-Adapter influences the generation primarily in the early denoising steps, with diminishing effects in the later steps. However, further investigation of this behavior is outside the scope of this study.

While the Knob system is designed to balance coarse and fine-grained controls dynamically, the lack of a dedicated coarse-grained module in T2I-Adapter causes the model to lose spatial coherence when we apply our Knob mechanism for it, especially when the knob has low value. This issue became particularly evident when trying to generate images based on prompt only, as the model struggled to infer the missing spatial structure, leading to distorted or incoherent outputs.

In contrast, the KnobGen framework, including the CGC and FGC, demonstrated superior flexibility and performance. By incorporating both high-level abstractions and detailed refinements, KnobGen could adapt dynamically to the varying levels of detail in the input sketches. The CGC in KnobGen helps preserve the overall structure and semantics of the image, while the FGC ensures that fine details are accurately rendered.

### C.2 More Qualitative Results

In this section, we present additional qualitative results to demonstrate the effectiveness and versatility of our proposed KnobGen framework further. Figure 10 and  11 showcases the model’s ability to handle a wide range of input sketches, from highly detailed professional-grade drawings to rough, amateur sketches.

Figure: Figure 10: More qualitative results on novice and professional-grade sketches
Refer to caption: extracted/5919645/image_files/single_image_appendix.jpg

Figure: Figure 11: More knob spectrum results
Refer to caption: extracted/5919645/image_files/knob_spectrum_appendix.jpg

## Peer Reviews

confidence: 5
contribution: 2
initial_rating: 5
presentation: 2
questions: See weaknesses
soundness: 2
strengths: [+] The paper is easy to read, and generally well written.

[+] The work addresses the research gap of allowing user control the influence of sketch and text on the generated image useful for end-users ranging from novice to professionals.
summary: The paper proposes "KnobGen", a novel algorithm for sketch+text-based image generation and provides the user control over the balance between fine-grained and coarse-grained queries coming from the input sketch and textual prompt respectively. It proposes a dual-pathway framework that democratises sketch+text-based image generation by adapting to varying levels of sketch abstraction and user-skills. It proposes a Coarse-Grained Controller (CGC) block for high-level semantics and a Fine-Grained Controller (FGC) block for further refinement of fine-grained features in the final output. With the possibility of controlling the relative strengths of these modules, this method can control how fine or coarse grained the final output will be. Finally, it also proposes a new sketch dataset on top of the MultiGen-20M dataset. Experimental results shows this method to outperform other popular methods like ControlNet, T2I-Adapter, etc.
weaknesses: [-] The paper includes a qualitative and quantitative comparison with several SoTA methods. However, a thorough quantitative ablation study examining the impact of each component would greatly enhance the reader's understanding of their relative importance. There exists an ablative study but it appears to be superficial and does not justify all design choices made in the paper.

[-] The quantitative results provided in the work lacks critical information regarding the value of knob used -- necessary to gauge the improvement of the proposed model. It would have been great to see the changes quantitatively on how the actual numeric values of the knob affecting the final output metrics.

[-] Generally the contribution factor of both micro and macro pathways should sum to 1. However, in this paper, the knob during training increases the contribution of micro pathway in each epoch, without decreasing the macro pathway. Won't doing this cause issues in the overall magnitude of the feature map (as one pathway is getting more weightage than the other)?

[-] Any particular reasoning behind using a "tanh" instead of any other function in knob during training for increasing the contribution of micro pathway? It would have been great to see ablation in this aspect as well, to fully justify this design choice.

[-] Other SoTAs like ControlNet also provides a balancing factor to control sketch-conformity. The proposed method should be compared in this aspect as well to check how granular the control is compared to SoTAs.

[-] It would be very interesting to see "sketch-only" generation results, either by passing null-prompt or making the text-pathway weighting factor to zero.

---

confidence: 5
contribution: 2
initial_rating: 5
presentation: 2
questions: Please refer to weaknesses.
soundness: 2
strengths: - The proposed method works for input sketches with varying abstraction levels, ranging from amateur and professional sketches. This inclusiveness is meaningful in practice as it can expand the scope of end-users with different needs and drawing skills.
- The design of the modulator during model training is interesting. The goal is to harmonise the dual-path conditions, thus achieving more enjoyable results. The intuition to let the coarse-grained cues dominate at the early denoising steps and gradually increase the impact of fine-grained cues is sound.
- The degree of alignment between the input sketches and the generated images is controllable during the inference. Such flexibility is desirable for boosting the applicability of sketch-guided text-to-image generation.
summary: This work proposed a sketch-based image generator that accepts sketches with different complexities from novice users and professionals. And reasonable outcomes (i.e., high-quality images) can be obtained in either case. At its centre is the proposed dual-path way conditional diffusion model, which can handle the coarse-grained and fine-grained conditions separately and simultaneously. Experimental results validated the flexibility and effectiveness of the proposed method for sketch-to-image generation.
weaknesses: - The professional sketches (Multi-Gen-20M) considered in this work are in binarised versions of HED edges, which is very different from what a real artist would draw (no artist or professional sketcher would produce lines like those in Figure 1). This makes the basic assumptions/conditions of the paper not very rigorous, somewhat deviating from the ambitious objectives, i.e., dealing with pro-sketch and any other complexity levels with a unified model. 
- The modulator is heuristically designed. It is hard to justify if there is a scalability issue that might need tedious hyperparameter tuning for diverse training data.
- The effectiveness and applicability of the knob mechanism is questionable. 
    - From Figure 6, the effect does not seem very pronounced: in the volcano example, the volcano corresponding to the intermediate gamma value appears to match the details of the input sketch better; in Keith's example (the second row from the bottom), the changes in facial details are also not noticeable. 
    - Besides, the user has to try different knob values until satisfaction (and this may be pretty different for diverse input sketches) since it has no apparent relation to the user's need for the complexity level from the input sketches.
    - The impact of fine-grained cues is hard to manage precisely, as they have been injected into the model at early denoising steps, and the effect will last in the following denoising steps.
- The current competitors in experiments are not designed for sketches. It would be great if some sketch-guided image generation works, e.g., [a], could be compared and discussed.
- There is a “second evaluation set” with 100 hand-drawn images created by novice users used for experiments. It would be great to show these sketch images for completion.

[a] Sketch-Guided Text-to-Image Diffusion Models, SIGGRAPH 2023

---

confidence: 5
contribution: 2
initial_rating: 1
presentation: 1
questions: The writing is not good, since there are many sentences we can not understand.
soundness: 2
strengths: 1. The authors provide visually appealing figures that make the content engaging and easy to understand.
2. Comprehensive experiments demonstrate the effectiveness of the proposed method, showcasing its potential in real-world applications.
summary: In this paper, the authors introduce an new dual-pathway framework that aims to overcome the shortcomings of existing sketch-based diffusion models. By considering both fine-grained and coarse-grained features, this approach elegantly combines high-level semantic understanding with low-level visual details. The proposed method not only enhances the connection between user input and model robustness but also paves the way for more effective results in sketch-based tasks.
weaknesses: 1, I can not follow this paper. The writing is bad, since there are many sentences I can not understand.  In introduction,  the presentation is not good.  (1)  ‘Furthermore, we observed that the quality and alignment of the generated images with the input sketch are highly sensitive to the weighting parameter that governs the model’s dependence on the condition, Figure 2. (2) 'Additionally, the removal of the text-based conditioning in DM makes these models ignore the semantic power provided by text in diffusion models trained on large-scale image-text pairs, Additionally,...'. There are two ‘Additionally’ , which is not enjoyable.  (3)  'Professional-oriented models like ControlNet and T2I-Adapter are designed to handle only artistic-grade sketches Fig. 3.a, while amateur-oriented approaches Koley et al. (2024), cater to novice sketches without text guidance Fig. 3.b'.  In some places it is Figure , while some ones are Fig..  (4) 'The Macro Pathway extracts the high-level visual and language semantics from the sketch image and the text prompt using CLIP encoders and injects them into the DM via our proposed Coarse-Grained Controller (CGC)'.  too much ‘ and’ 

2. Some figure captions lack clarity; for instance, in Figure 2, the term “weights” could use more explanation.

3. There are concerns that the overall writing style may resemble that produced by a language model, suggesting a need for a more personal touch.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: Please refer to the questions in the “Weaknesses” part.
soundness: 2
strengths: 1.	KnobGen introduces a dual-pathway framework that balances the effects of both coarse-grained and fine-grained features, resulting in better performance compared to other sketch-based image generation methods.  

2.	The authors introduce a dynamic modulator to regulate the influence of the CGC and FGC modules during training, thereby preventing premature overfitting to fine details.
summary: In this paper, the authors propose a sketch-based image generation method which can generate high-quality images with varying levels of sketch complexity, named KnobGen. It designs a coarse-grained controller module and a fine-grained controller module to learn high-level semantics and detailed refinement separately. Then the authors introduce a knob inference mechanism to align with the user’s specific needs.  The experiments have shown superior performance compared to other sketch-based images generation methods.
weaknesses: 1. Although the proposed method balances the effects of coarse-grained and fine-grained features, it may not meet users' expectations when the input sketches are highly abstract. For example, as depicted in the last column of the second and third rows in Figure 4, the generated images align with the distortions shown in the sketches. Although this effect can be adjusted by the hyperparameter γ, changing the “controllable scale” within the ControlNet and T2I-adapter can also yield similar outcomes.  To be specific, the authors are recommended to provide additional results based on varying the 'controllable scale' of ControlNet and T2I-adapter. This would illustrate that the proposed method can meet user needs without the need for adjusting γ. 

2. Setting a hyperparameter γ to control the conditional signal based on the denoising steps during inference is a common operation in T2I task, which is not a novel technical contribution. The authors are suggested to demonstrate the differences between this method and previous ones. For instance, they could illustrate the relationship between the tanh-based modulator used in training and the γutilized during inference.

3. There are still some experimental issues:

(1). The evaluation of the generated results is somewhat subjective. Additional user studies could further demonstrate the strengths of the proposed method. Specifically, the authors can prepare more than 50 sets of sketches, which need to be evenly distributed across different levels of complexity. Users can then rank the results generated by the proposed method and other sketch-based methods.

(2). Since these models that assess user preferences are trained on their own designed datasets, a single aesthetic score is insufficient. The authors are suggested to conduct quantitative experiments using the HPS-v2[A] and Pick score[B] metrics, which are widely used for comprehensively assessing the generation quality.

[A]. Wu X, Hao Y, Sun K, et al. Human preference score v2: A solid benchmark for evaluating human preferences of text-to-image synthesis[J]. arXiv preprint arXiv:2306.09341, 2023.

[B]. Kirstain Y, Polyak A, Singer U, et al. Pick-a-pic: An open dataset of user preferences for text-to-image generation[J]. Advances in Neural Information Processing Systems, 2023, 36: 36652-36663.

(3). In the ablation study, there are too few examples, as the displayed images only include results of human portrait generation. The authors are recommended to add results of sketch generation for other categories.  And the authors are recommended to provide more quantitative ablation results, with the same metrics as the quantitative experiments to demonstrate the effectiveness of the proposed method.