Nodes/SEGA for Anima/SEGA for Anima
ComfyUI Node

SEGA for Anima

Make your 2B DiT draw bigger without falling apart

By Filexor·Created 2 months ago·Updated 2 months ago· 0
SEGA for Anima
  • model
  • MODEL
training_resolution1024
theta10000
base_mscale_formulapower_res
base_mscale_coefficient0.080
mscale_alpha0.150
mscale_beta1.500
mscale_min1.000
d_mul2.000
log_s_mul0.100

Anima is a DiT, and DiTs hit a wall when you push past training resolution: the RoPE positional embedding stops extrapolating, and your 1536-square prompt that was perfect at 1024 comes back with doubled limbs, warped architecture, or a second character where the composition should be. "SEGA for Anima" is a model patch that attacks that directly. Drop it between Load Diffusion Model and KSampler, and it rescales the model's positional embeddings based on what's actually in your image at each step, so higher-res generations hold together instead of slowly disintegrating.

It's a real paper under the hood - SEGA: Spectral-Energy Guided Attention for Resolution Extrapolation in Diffusion Transformers, which got a genuinely warm reception on r/StableDiffusion in May 2026 - and this is the Anima-specific ComfyUI port of it. The name collides with the old SD 1.5 "SEGA" style-mixing node, which is annoying but unrelated.

How it actually works

Anima's position embedding uses 3D RoPE with a base frequency (theta, default 10000). Generate above training size and the naive frequencies don't stretch far enough, which is why big outputs get structurally weird. The standard fix is NTK-style frequency scaling; this node does that too, then layers SEGA on top.

The clever bit: at each step it takes the current spatial latents, runs a 2D FFT, and measures where the spectral energy actually lives. Dimensions carrying more signal get a smaller mscale, sharpening where the model pays attention, while dead frequency bands get scaled up. It's content-aware RoPE scaling - the model decides how to extrapolate based on what it's currently drawing, rather than applying one dumb ratio everywhere. That's what makes it different from just cranking theta and hoping.

One thing to know: the code refuses to run on anything that isn't Anima (Model input is not Anima model). It's reading the Cosmos-Predict2 MiniTrainDIT internals and swapping its RoPE embedder, so no, you can't use it on Illustrious or Flux. Anima-only, by design.

The inputs that matter

Nine knobs, and the author's own README admits the last six are guesswork ("the creator of this node does not know what rest of parameters do. You may do experience with those"). Honest, and helpful - it tells you where to focus.

  • training_resolution (1024) - the resolution you claim the model was trained at. This is the one to set, and the first thing to touch when output breaks. Anima-Base v1.0 was trained up to 1536, so if you're on the base, leaving this at 1024 is conservative; if generation collapses, lower it.
  • base_mscale_formula - power_res (default) or log_res, how the base scale grows with resolution ratio, with base_mscale_coefficient (0.08) controlling the curve.
  • theta (10000) - the RoPE base frequency. Raise it to lean on extrapolation harder.
  • The rest - mscale_alpha (0.15), mscale_beta (1.5), mscale_min (1.0), d_mul (2.0), log_s_mul (0.1) - shape the SEGA allocation and NTK factor. Defaults are a fine starting point; the author says experiment.

Output is a single MODEL, which feeds straight into your KSampler. The rest of your workflow doesn't change - it's a patch, not a new sampler or a second pass.

Installing

No models to download, no pip install, no requirements.txt - the whole node is one file that leans on what ComfyUI already ships (torch, einops, torchvision, and the built-in Cosmos modules). The catch is the opposite: it uses the new patcher-extension API (comfy.patcher_extension, comfy_api.latest), so you need a recent ComfyUI. If it fails to register, update ComfyUI first, not the node.

cd ComfyUI/custom_nodes
git clone https://github.com/Filexor/SEGA_Anima.git

Then restart ComfyUI. Or search "SEGA for Anima" in ComfyUI Manager → Custom Nodes Manager and let it handle it. The node lives under Add node → model → patch → anima.

Troubleshooting, in the author's own order

  1. No image appears → lower training_resolution. Too low causes the opposite problem, structural inaccuracy, so it's a sweet spot, not a minimum.
  2. Still bad → raise CFG; high-res DiT output wants more guidance than low-res.
  3. Then play with theta, base_mscale_coefficient, mscale_alpha, d_mul.
  4. Last resort → more steps.

Worth a reality check: this port is brand new and essentially unproven in the wild. The paper is legit, but nobody has accumulated a month of "here's what actually works" threads for this exact node yet. If your goal is simply "bigger Anima image," the community's battle-tested path remains latent upscale to ~1.25x at 0.25–0.35 denoise between two KSamplers - boring, reliable, and free. SEGA is the research-y alternative for pushing one pass natively past 1536. Try both; that's what they're for.

Categorymodel/patch/anima

Inputs (10)

NameTypeDefaultDescription
modelMODEL
training_resolutionINT10241–65536
thetaFLOAT1000010–1000000
base_mscale_formulaCOMBOpower_res2 options: power_res, log_res
base_mscale_coefficientFLOAT0.080-100–100
mscale_alphaFLOAT0.150-100–100
mscale_betaFLOAT1.500-100–100
mscale_minFLOAT1.000-100–100
d_mulFLOAT2.000-100–100
log_s_mulFLOAT0.100-100–100

Outputs (1)

NameTypeDescription
MODELMODEL