Nodes/ComfyUI-UniWorld-jd17/UniWorld Scheduler (for FLUX)
ComfyUI Node

UniWorld Scheduler (for FLUX)

The FLUX scheduler that computes its own shift

By judian17·Created about a year ago·Updated about a year ago· 21
UniWorld Scheduler (for FLUX)
  • model
  • latent
  • SIGMAS
steps30
denoise1.00

If you've loaded one of this pack's UniWorld workflows and wondered why there's a scheduler with a made-up-looking name sitting next to BasicScheduler, here's the short version: it's the node that computes FLUX's timestep shift (mu) from your actual latent size instead of using a canned schedule. It ships with the ComfyUI-UniWorld-jd17 pack, an unofficial ComfyUI port of the image-editing half of PKU-YuanGroup's UniWorld-V1, and it's a drop-in sigma provider for SamplerCustomAdvanced.

Why it exists

FLUX is a flow-matching model, and flow-matching samplers have a knob ComfyUI usually sets for you: a shift that decides how sampling effort is spread across the trajectory. The right value depends on how many tokens the model is processing - bigger image sequences want a different shift than small ones. The original UniWorld pipeline computes this on the fly with a helper called calculate_shift, and this node is that helper, dressed up as a ComfyUI node. The author of the pack says it plainly in the README: most of the code was written with Gemini's help and "probably" works. Rough edges included.

How it works

The node reads your model's scheduler config (base_image_seq_len, max_image_seq_len, base_shift, max_shift) off the MODEL object you feed it, measures the sequence length of the packed latents it's given, plugs all that into the standard shift formula, and instantiates its own FlowMatchEulerDiscreteScheduler with the resulting mu. Then it returns the sigmas that scheduler produces. If the config can't be read it falls back to FLUX defaults and prints a warning - so keep an eye on the console the first time you run it; it logs the mu it calculated, which is a nice sanity check that it's doing real work.

The inputs that matter

  • model - wire in the MODEL from your UNETLoader. This isn't just plumbing; the node introspects it for the scheduler config.
  • steps (default 30) - total denoising steps.
  • denoise (default 1.0) - drop it below 1 for img2img-style passes; the node recomputes total steps and trims the sigma tail so the effective schedule still matches.
  • latent - the VAEEncode output. It's only used for sequence length, which is what drives mu, so you do need it connected.

The single output, SIGMAS, goes into SamplerCustomAdvanced alongside BasicGuider, KSamplerSelect and RandomNoise. That's the whole job.

Install and gotchas

This pack has no heavy install story of its own - the pain is all in the model weights. Install it via ComfyUI Manager (search "ComfyUI-UniWorld-jd17") or:

cd ComfyUI/custom_nodes
git clone https://github.com/judian17/ComfyUI-UniWorld-jd17
# restart ComfyUI

The pack pins transformers==4.50.0 in its requirements - the author tested that 4.52.3 errors out. That pin mostly matters for the encoder nodes, but it's a shared requirement, so expect a version juggle if you have other packs demanding newer transformers.

The shipped example workflow (workflow/uniworld-test.json) keeps both BasicScheduler and UniWorldScheduler on the canvas, so you can literally swap the sigmas wire between them and eyeball the difference. Because this node derives mu from your latent rather than assuming, it adapts whether you're running the fp8 or bf16 Flux weights from the pack. If you get a black or mushy result, check the console for the mu line and make sure the model input is actually the UniWorld Flux UNet - feed it a random checkpoint and the scheduler config read will fall back to defaults, silently undoing the point of the node.

Categorysampling/custom_sampling/schedulers

Inputs (4)

NameTypeDefaultDescription
modelMODEL
stepsINT301–10000
denoiseFLOAT1.000–1
latentLATENT

Outputs (1)

NameTypeDescription
SIGMASSIGMAS