ComfyUI Node

Stylize

X1Stylize is the comic/fine-art shortcut

By criskb·Created 7 months ago·Updated 5 months ago· 0
Stylize
  • image
  • mask
  • image
  • mask
  • stylize_info
settings_json{"posterize_bits":8,"halftone_strength":0.0,"halftone_size":8,"stylize_ink_strength":0.0,"stylize_ink_threshold":0.28,"mask_feather":12.0,"invert_mask":false}

Every now and then you want the image to stop looking like a render and start looking like a print - flat color bands, halftone dots, ink lines. The usual route is a pile of filters that fight each other. x1Stylize bundles the three classic deterministic stylizers - posterize, halftone, and ink linework - into one node with a single settings blob, so you can push an image toward "screen-printed poster" or "inked comic panel" without installing a graphic-design plugin.

How it works

The three effects stack on top of each other, and each is off until you turn it on:

  • Posterize (posterize_bits, default 8 = full range, effectively off). Drop to 4 or 3 and the image collapses into distinct color bands. This is the flat-graphic look - each band gets the average of its range, so gradients become hard edges. The "bits" phrasing is the classic Photoshop posterize scale; 8 bits is the original range, each step down halves the color levels.
  • Halftone (halftone_strength, default 0 = off; halftone_size, 8). When strength is above zero, the node renders the image through a halftone dot screen - brightness becomes dot size, exactly like a newspaper photo or old comic print. halftone_size is the dot pitch in pixels: small for fine detail, big for an aggressively retro look.
  • Ink (stylize_ink_strength, default 0 = off; stylize_ink_threshold, 0.28). This is the line-art pass - it extracts edges and dark areas as black "ink" over the image, thresholded so only strong contrasts get the treatment. Combined with posterize it reads like a cel or a screen-print; on its own it's a stylized sketch effect.

Because they're independent, you can dial in any combination: posterize alone for flat graphic, halftone + low posterize for a printed texture, ink + posterize for a comic panel.

The inputs that matter

All settings live in a settings_json string, prefilled:

  • posterize_bits (8) - color levels; lower = flatter.
  • halftone_strength (0) / halftone_size (8) - dot-screen amount and pitch.
  • stylize_ink_strength (0) / stylize_ink_threshold (0.28) - ink amount and edge threshold.
  • mask_feather (12.0) / invert_mask - for when the optional mask input limits the effect to a region.

Outputs are image, mask (the affected region), and stylize_info (a one-line log of the active settings).

Installing it

It's part of the MKRShift Nodes pack. ComfyUI Manager: search "MKRShift", install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

Restart after. No models - these are deterministic pixel operations that run in milliseconds on CPU.

Gotchas

The settings_json rule applies: invalid JSON silently resets to defaults, so if your halftone "stopped working," check the braces before anything else. And a stylistic note: halftone and ink are resolution-sensitive. A halftone dot pitch of 8px looks like retro print at 512px and disappears into noise at 2048px. Pick the dot size on the resolution you're actually delivering. Also worth knowing: posterize on skin produces posterized skin - if you're stylizing a portrait, mask the face out first or run it at a high bit count and let the halftone carry the look.

CategoryMKRShift Nodes/VFX/Stylize

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
settings_jsonSTRING{"posterize_bits":8,"halftone_strength":0.0,"halftone_size":8,"stylize_ink_strength":0.0,"stylize_ink_threshold":0.28,"mask_feather":12.0,"invert_mask":false}
maskoptMASK

Outputs (3)

NameTypeDescription
imageIMAGE
maskMASK
stylize_infoSTRING