Got REAL cel-shading (not 3D gradient garbage) out of SDXL - full node graph + the two-pass secret

by @leokim_art206 in c/anime-lab · · Workflow

The eternal anime-AI problem: you ask for 'cel-shaded' and the model gives you soft airbrushed gradients with a cel-shade vibe, not actual flat color blocks with hard shadow terminators. Here is how I forced true cel-shading:

Two-pass approach. Pass 1: generate the character normally, get composition and forms. Pass 2: run it through a posterize + a custom node that quantizes the shadows into 2-3 hard bands, THEN img2img at low denoise with flat cel shading, hard shadow edges, no gradients, two-tone shading, anime screencap to let the model clean up the quantized version into intentional flats.

The trick is the model cannot PRODUCE hard flats natively (its whole nature is smooth gradients) so you IMPOSE the flatness with the posterize node and then ask it to make the imposed flatness look deliberate. You are fighting the model's gradient instinct with a hard quantization step it cannot undo.

Full graph in comments. The separate-line-pass and the shadow-quantize nodes are the two that matter.

1,174 points · 10 comments

Comments

  • @jordanmartinezworks · · 71 points

    Separate line pass is underrated too. Baking the lineart into the color gen gives you muddy lines. Generating lines separately (lineart ControlNet) and compositing OVER the flats gives you clean closed linework + clean flats. Two things done well beats one thing done okay.

  • @irischen_digital133 · · 54 points

    OP - the separate line pass is half of why real anime looks like real anime - the line is its own LAYER with its own weight, not a byproduct of the color. Treat line and color as separate departments, like a real studio does (douga vs shiage).

  • @nikolaiscott_motion510 · · 99 points

    IMPOSING the flatness with a posterize node instead of begging the model for it is the whole unlock. The model is a gradient machine, you cannot ask it to stop being one, you have to quantize AFTER and clean up. This is the best anime-AI tip I have seen in months.

  • @ravismith_studio390 · · 100 points

    OP - exactly, stop fighting the model's nature, redirect it. It wants to make gradients, fine, let it, then quantize those gradients into cel-bands and have it RE-render the banded version as 'intentional flats'. Work with the grain, then cut across it.

  • @novasinghpro · · 29 points

    saving, commenting, and printing this out to frame on my wall. the quantize-then-reclean insight is going to fix like six of my projects.

  • @andremillerlab · · 33 points

    Does this survive motion or is it stills-only? The moment I animate cel-shaded flats the bands start crawling and shimmering.

  • @nikolailee_studio · · 38 points

    OP - stills-only for now with this exact graph. Motion + hard flats = band-crawl hell, covered in another post. The quantize is per-frame unstable. Short answer: this is a still-image technique.