Nodes/ComfyUI EasyUse Anima/Easy Anima Safe PAG
ComfyUI Node

Easy Anima Safe PAG

Anima gets a coherence knob, no second checkpoint

By n0va39·Created 4 months ago·Updated 2 days ago· 35
Easy Anima Safe PAG
  • model
  • model
◄scale4.0►
◄block_indices18►
◄perturbation_strength0.75►
◄head_indices►
◄start_percent0.000►
◄end_percent0.700►
◄rescale0.20►
◄rescale_modefull►

Anima is the anime base that finally made people leave SDXL behind - a 2B DiT on NVIDIA's Cosmos-Predict2 with a Qwen3-0.6B text encoder, and prompt comprehension that Illustrious and NoobAI structurally couldn't match. It's also slow for its size, has no ControlNet, and wobbles: compositions come out soft, busy scenes drift, and a latent upscale shows the seams. Safe PAG is the knob people reach for when they want more order without cranking CFG into burnt territory.

Easy Anima Safe PAG applies that guidance to Anima-family models as a plain model patch. No second checkpoint, no extra weights, no external node pack.

What it actually does

This is PAG - perturbed-attention guidance, the trick from pamparamm's sd-perturbed-attention. Run the model twice, once normally and once with self-attention deliberately weakened, then treat the difference between the two predictions as extra guidance. The weak pass says "here's what this step looks like without attention doing its job," and the delta pushes the sampler back toward composition it would otherwise lose.

So the node appends a copy of your first conditioning to the condition batch, forcing one extra padded prediction. While that runs it temporarily swaps compute_attention on the self-attention modules of whichever blocks you named, blending their output toward the value path by perturbation_strength, then restores them after inference. The post-CFG callback does:

guidance = (cond_pred - pag_pred) * scale
denoised = cfg_result + guidance

scale of 0 short-circuits everything and hands your model back untouched. Nothing stays monkey-patched, and reapplying the node replaces its own correction instead of stacking it. The catch: that extra prediction is a second forward pass through the blocks you patch, for the part of the schedule you leave enabled. It is not free, and it is not an upscaler.

The inputs that matter

Nine fields, but a beginner only touches three:

  • model - the MODEL wire from your Anima loader.
  • scale (default 4.0) - how hard the correction pushes. Start here. Up for more coherence, down if the image starts looking hammered and contrasty.
  • block_indices (default "18") - which transformer blocks get perturbed; single numbers or ranges like 18-20 or 18,20,22. On the 28-block Anima, block 18 mid-stack is a sane place to stay.

The rest are worth understanding before you touch them. perturbation_strength (0.75) is how far attention is blended toward the identity path - 0 is normal attention, so no guidance; 1 is the full weak pass. start_percent and end_percent (0 and 0.7) bound where guidance is live; leaving the last 30% unguided is deliberate, since guidance early fixes structure and guidance late chews details. head_indices empty means all heads - leave it. rescale (0.2) and rescale_mode (full or partial) damp the contrast spike by rescaling guidance toward the normal prediction's std dev; raise rescale if output looks oversharpened.

One output: model - the patched MODEL, wired into your KSampler exactly where the unpatched one was.

Wiring and install

Order matters: loader → (DAVE, if you use it) → Easy Anima Safe PAG → KSampler.

Install is the whole pack, since this node ships inside ComfyUI EasyUse Anima. Search "ComfyUI EasyUse Anima" in ComfyUI Manager (registry id comfyui-easyuse-anima), or:

cd ComfyUI/custom_nodes
git clone https://github.com/n0va39/ComfyUI-EasyUseAnima
pip install -r ComfyUI-EasyUseAnima/requirements.txt

Restart ComfyUI after. Requirements are light - requests and googletrans-py for the pack's translation features, no torch pins. The pack is big and most of it is prompt tooling you may never open; that's fine.

Where it bites

The node only understands one kind of model. Point it at an SDXL or Flux checkpoint and it fails loudly:

Anima Safe PAG expects an Anima/Cosmos/Predict2-style model with diffusion_model.blocks.

A block index your model doesn't have gets rejected with No valid block indices found.

It also insists on owning the condition-batch path. If another node has already wrapped sampler_calc_cond_batch_function and eaten the extended condition list, you get "did not receive the padded prediction." Stack cond-batch patchers carefully.

Check the console - the node announces itself when it engages:

[Easy Anima Safe PAG] active: blocks=[18], strength=0.750, heads=all, range=0.000-0.700, conds=2+pag
[Easy Anima Safe PAG] first-step mean |cond - pag| = ...

No log line means no guidance: either scale is 0, or your sampler's sigma never fell inside the start/end window.

Two caveats. The 28-block path is tested on ComfyUI 0.27.0 and 0.37.0; 40-block generation, Torch Compile and multi-GPU are unverified. And it won't silently replace the original AnimaSafePAG node - different node ID, you rewire it. Underneath is a vendored MIT copy of iljung1106's comfyui-anima-safe-pag with no weights or calibration assets, so there's nothing to download.

CategoryEasyUse Anima/Model Patches

Inputs (9)

NameTypeDefaultDescription
modelMODEL—
scaleFLOAT4.00–100—
block_indicesSTRING18—
perturbation_strengthFLOAT0.750–1—
head_indicesSTRING—
start_percentFLOAT0.0000–1—
end_percentFLOAT0.7000–1—
rescaleFLOAT0.200–1—
rescale_modeCOMBOfull2 options: full, partial

Outputs (1)

NameTypeDescription
modelMODELAnima MODEL with Safe PAG guidance; original MODEL is preserved.