Jags-color_drop
Posterizes to flat colors — when it isn't commented out
- images
- Image
Here's the whole pitch for Jags-color_drop in one sentence: feed it an image, and it crushes the color palette down to a handful of flat tones. Posterization, color flattening, whatever you call it - it's the classic prep step before vectorizing a raster image, which is exactly why it lives in a pack called VectorMagic.
The honest part comes second: in the version that's shipping, the code that actually does this is commented out. So treat this page as "what it's meant to do," with a reality check at the bottom.
What it's supposed to do
The node takes an image and quantizes it to number_of_colors flat colors. Under the hood it converts each image to a PIL image, runs Pillow's adaptive palette quantization - image.convert('P', palette=Image.ADAPTIVE, colors=number_of_colors) - and converts the result back to an RGB tensor. Adaptive quantization means Pillow picks the N most representative colors from your image rather than using a fixed palette, so a 4-color "drop" of a sunset actually keeps the four tones that matter.
The inputs
There aren't many:
- images (required,
IMAGE) - the image(s) to flatten. It loops over the batch, so a stack of images works. - number_of_colors (optional,
INT, default 2, range 1–4000) - how many flat colors you want. 2 is a hard posterization; 8–16 keeps the image recognizable while killing gradients; anything past ~64 stops being a "drop" and starts being the original with extra steps.
Output is a single Image (IMAGE) with the palette flattened.
The reality check
The shipped color_drop class declares all of this - the inputs, the output, FUNCTION = "flatten" - but the flatten method itself, and the category, are trapped inside a triple-quoted comment block in SVG_convert.py. The node registers and shows up in your node list, and the moment you run it ComfyUI goes looking for a method that doesn't exist and the execution errors out.
This is exactly what the pack's README warns about up front: "the work in this repo is not completed and still in progress and code will break until all things are sorted." The repo's last real activity was April 2025, so "in progress" has been a while. It's a shame, because the idea is sound - a one-node palette flattener is genuinely useful as a first step before SVG tracing or for flat-design looks.
If you hit the runtime error, your options are: fix the code yourself (uncomment the method block), or - my recommendation - don't build this into a workflow at all. The same job is a few core ComfyUI nodes away: convert to a color-reduced format or use any posterize/quantize utility node. The intent here is good; the execution is a victim of the pack's unfinished state.
Installing it
Same as the rest of the pack. ComfyUI Manager → search Jags_VectorMagic → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/jags111/ComfyUI_Jags_VectorMagic
Note the pack's requirements.txt installs a heavy batch of dependencies (ultralytics, librosa, clip-interrogator, opencv-python, …) for nodes you may never touch. If you're only here for the pack's segmentation tools, that's still how it comes - Manager installs the whole requirements list.
Short version: know it for the idea, don't count on it running as-shipped.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| number_of_colorsopt | INT | 21–4000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Image | IMAGE | — |