RoPE Extension Patch
Stop a huge frame from sampling outside its learned positions
- model
- model
This one solves a problem you can't see in the node, only in the output: on a frame wider or taller than the model was ever trained on, the positional encoding runs past the range it learned and the picture goes strange - repetition, stretched geometry, structures that repeat at a regular beat. RoPE Extension Patch rescales the positions on the fly so a big call stays inside the model's experience.
The problem it's fixing
Modern image transformers don't know where a patch is because of a lookup table; they encode position by rotating query and key vectors by an angle that depends on where the token sits - rotary position embedding, RoPE. The angles were tuned over a particular span of positions during training. Ask for 2560px when the model was trained around 1024–2048 and you are feeding it angles it has never seen. FLUX and MOSS-Image both carry a rope_options hook for exactly this, and this node drives it.
Different models want different corrections, and the node handles both. MOSS-Image widens its RoPE frequencies; FLUX compresses its positions. You don't choose - it detects the transformer and applies whichever that architecture reads.
How it works
It wraps the diffusion model's forward call. On each call it takes the latent's height and width, multiplies by the latent format's downscale to get image pixels, and computes a per-axis scale of native_side / side, capped at 1. Those two numbers are multiplied into whatever rope_options were already set - so it stacks with other patches rather than steamrollering them.
The cap at 1 is the important design decision. Calls at or under your native_side (in either axis) are passed through untouched, no wrapper cost beyond the check. That's what makes it safe to leave in a graph that also tiles: native-size tiles from a Tiled Diffusion Model Patch are already inside range, so they don't get scaled twice.
Inputs and output
model takes a MOSS-Image or FLUX 1 / FLUX 2 model. That's the whole supported list - the two architectures whose transformers read a RoPE scale.
native_side is the longest side in pixels you consider unscaled, default 2160, which is the long edge of MOSS-Image's widest 2 MP size at 21:9. Past that, the side gets scaled - 2304 comes out at about 0.94, a fairly gentle nudge. Drop it to 1024 if you're sampling a model whose comfort zone really is 1024 and you're pushing 1536.
Output is a patched model. Wire it before the sampler; it doesn't care which sampler.
Installing it
ComfyUI Manager, search WAS Node Suite v3, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git
ComfyUI 0.14.0+, Python 3.10+, no pip install, no weights fetched, no network calls. If you've been avoiding this pack because of the 2024-era threads about broken imports and dependency downgrades, those describe v2; v3 ships with no default requirements at all.
Where it goes wrong
this model's transformer is X, which reads no RoPE scale. You've wired something that isn't MOSS-Image or FLUX 1/2 - SDXL, an SD3 model, Flux 3. The node raises rather than silently doing nothing, which is the right call: take it out.
Expecting it to unlock unlimited resolution. It keeps positions in range; it doesn't give the model knowledge it never had. At 1.5× native you'll often get a clean result. At 4× you're still better off with tiling, or with the tiled patch plus this, in that order: tiled patch first, RoPE patch after.
Setting native_side far below the model's real training size. Then every normal render gets scaled, and you've quietly degraded the images you were happy with. Unless you're deliberately experimenting, leave it at the default.
Wiring it late in the chain. It only sees calls that pass through it. If a downstream node rebuilds the model rather than patching it, your scale is gone. Keep it near the sampler, after the loaders and LoRA loaders.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | A MOSS-Image or FLUX 1 or 2 model; MODEL. | |
| native_side | INT | 2160256–16384 | Longest side in pixels sampled unscaled. 2160 = MOSS-Image's widest 2 MP size, 21:9; a side past it is scaled, as 0.94 at 2304. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | The model with RoPE scaled on large calls, for any sampler; MODEL. |