✨S2GuidanceDIT
Make your DiT model actually listen, by breaking it on purpose
- model
- model
Your Chroma or Flux Klein render gets most of the prompt right, and then misses that one object you were explicit about. You could bump CFG, but on modern DiT models that's how you get oversaturation and fried colors, and on guidance-distilled ones it doubles your render time for a correction the model wasn't built for. S²-Guidance takes a different route: it improves prompt adherence with no retraining, no extra weights, and no new model download - by randomly breaking the model each step and learning from its mistakes.
What it actually does
S²-Guidance (stochastic self-guidance) comes from a 2025 paper by Alibaba researchers and friends, arXiv 2508.12880. The idea is sneaky in its simplicity: at every sampling step, randomly drop a handful of the model's transformer blocks, run a prediction through that crippled subnetwork, and subtract it from the normal CFG result. The subnetwork is worse than the full model, so the subtraction pushes the prediction away from the paths a broken model would wander down. The paper's headline claim is that this beats plain CFG and CFG++ across text-to-image and video. The r/StableDiffusion thread announcing it racked up 150 points in a day, and the top comment was literally "can we get a comfy node for this?" - this is that node.
When it shipped, this was one of the cleanest answers to the question of how to get better prompt adherence on DiT models without touching weights.
How this node works
✨S2GuidanceDIT is a model patch, not a new sampler. It clones your model and registers a post-CFG hook, so it runs after ComfyUI computes the CFG result on each step. Internally it:
- Counts the transformer blocks in your loaded model (it recognizes double/single block layouts across Flux, Chroma, AuraFlow, Wan, Lumina, Hydit, PixArt, Qwen-Image, and a long list of others).
- Randomly picks which layers to skip, based on
skip_layers_percentage, and patches them so their output equals their input - effectively removing them for that step. - Runs one conditional prediction through that degraded subnetwork.
- Subtracts it, scaled by the guidance strength, then re-normalizes so the colors and intensity match the original CFG output.
That random pick each step is the "stochastic" part - the layers being skipped change every step, which the paper argues makes the guidance more robust than a static skip. The price: an extra forward pass per step, so expect your sampling time to roughly double, same as CFG itself does.
Inputs that matter
- model (required): your loaded DiT model. Wire the node's output into your sampler instead.
- s2_guidance_scale (Float, default 0.25, range 0–2): the strength of the correction. Start at 0.1–0.5. Above that you oversharpen and get artifacts.
- skip_layers_percentage (Int, default 1, 1–100): what percentage of layers get dropped each step. The default 1 means roughly one block in a big model - subtle. The 1–10 range is the sweet spot; crank it and the subnetwork gets dramatically worse, which makes the subtraction stronger.
Output: a single patched model, which feeds your sampler just like the unpatched one would. There's exactly one thing to get right: the sampler must read from this node, not the original model loader wire, or nothing happens.
Installing it
Find ComfyUI-S2Guidance in ComfyUI Manager's install search and restart, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/orpheus-gaze/ComfyUI-S2Guidance.git
Then restart ComfyUI and refresh the tab. The refreshing part is this pack doesn't have the usual dependency tax: no pip requirements beyond torch and numpy, which ComfyUI already ships, and no model files to download - it's a lightweight patch. Two caveats: it's built on ComfyUI's newer comfy_api extension framework, so if the node doesn't appear in the search, update ComfyUI first. And it only works on DiT architectures; if the console prints "Model not supported for S²-Guidance", the node silently passes your model through unchanged - SD1.5/SDXL UNet models will hit this, and that's expected.
The trap to watch
Because the correction is added on top of CFG, treat the two as interacting knobs: on distilled models you still want CFG near 1, and you're using S²-Guidance to recover adherence instead of raising it. Compare against your normal workflow with a fixed seed - single-image "improvements" are usually just luckier seeds, and this is a subtle effect at sensible scales. Start small, keep skip_layers_percentage in single digits, and judge it over a batch, not one render.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| s2_guidance_scaleopt | FLOAT | 0.250–2 | The strength of the S² guidance scale. (no effect=0.0, strong effect=2.0, default=0.25) |
| skip_layers_percentageopt | INT | 11–100 | The skip_layers_percentage variable dictates the percentage of how many layers out of the total that should be skipped. (one=1, all=100, default=1) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |