Noline Process
De-Line an Image Before I2I So the Model Colors It, Not Traces It
- image
- image
- show_help
If you've ever run img2img on a black-and-white line drawing, you know the failure mode: the model traces the lines instead of coloring inside them, and you get the same sketch with a wash of color slapped over it. Noline Process is the workaround - it removes the lineart and averages the colors out into flat patches, so the img2img pass has nothing to trace and has to actually reimagine the shading. It's a preprocessor, and it's aimed squarely at the anime/lineart workflows this pack is built around.
How it works
This is the most interesting node in the pack, because it does real work. The pipeline, straight from the source:
- Find the lines with an XDoG filter - extended difference of Gaussians, the same edge-detection family the lineart ControlNet preprocessors use. The result is binarized (Otsu thresholding) and inverted, so you end up with a mask of exactly where the line art sits.
- Find the major colors in the image - every color that covers more than 5% of the pixels gets pulled out, then near-identical colors (within a CIEDE2000 color-distance threshold) get merged, so a flat-color drawing with a few shades of the same tone collapses into a few distinct swatches.
- Fill the lines. It generates a random color that's far from every major color in Lab space, paints all the line pixels with it, then flood-fills outward from each line pixel, replacing that marker color with the average of neighboring pixels - so lines get replaced by a gradient bridging the colors on either side. A Gaussian blur smooths the seams.
The result is your drawing with the line art effectively erased and the colors smeared together into soft, connected regions. That's the ideal img2img input: the model sees a color field and the shape, not a set of lines to trace.
The inputs and outputs
Inputs are just image - nothing to tune, which is a blessing and a curse. The whole pipeline uses hard-coded thresholds (the 5% major-color floor, the XDoG sigma and gamma values), so you can't adjust how aggressive the line removal is. Feed it a clean flat-color drawing and it works great; feed it a noisy photo and the thresholds fight you.
Outputs are image (the de-lined result) and show_help (a one-line description of the node in Chinese). Wire image straight into your img2img sampler's latent input.
Installing it
It ships in JackEllie/ComfyUI_AI_Assistant, a fork of tori29umai0123's AI-Assistant. ComfyUI Manager, search "ComfyUI-AI-Assistant", or:
cd ComfyUI/custom_nodes
git clone https://github.com/JackEllie/ComfyUI_AI_Assistant
Restart after. No models needed. Dependencies are light - opencv-python in requirements.txt, plus skimage and torchvision imported at module load (ComfyUI already ships torchvision; if the pack fails to import, install scikit-image).
Gotchas
Three things will bite you. First, it's slow: the line-fill step loops over pixels in pure Python, so a 1024px image takes a noticeable while. Don't put it in a workflow that runs on every batch. Second, it assumes relatively flat-color art - the whole color-consolidation step is designed for cel/anime shading, not photographic input. Third, because thresholds are hard-coded, if the output looks over- or under-processed you can't fix it from the node UI; you'd have to fork the source. For the narrow job of prepping lineart for I2I it's genuinely useful - just know what you're signing up for.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| show_help | STRING | — |