EditUtils: Boogu Edit Apply (ROPE Control) lrzjason
Repositioning References Without Regenerating
- model
- model
Here's the mental model for BooguEditApply_EditUtils: Boogu knows where things are on the canvas because it bakes positional information into the model through its rotary embedding (the code calls it OmniGen2RotaryPosEmbed - it computes positions from the image sizes it's given). This node patches that position computation so each reference image can be told to sit somewhere other than its natural top-left home. That's the whole trick, and it's what makes "regional editing" possible: put a reference at the right spot on the canvas, and Boogu treats it as content living there.
The interface is almost insultingly simple given what it does. Required: model in, model out. Optional: debug_log. That's it. No ROPE values, no offsets, no position numbers anywhere on the node - because they don't belong here. The offsets are set per-image back on the Config Preparer (rope_x_offset / rope_y_offset on BooguConfigPreparer_EditUtils), get packed into that image's config, and ride through the conditioning chain. This node just installs the machinery that reads them back out.
Mechanically it's a model patch, and a careful one. It detects that you've handed it a Boogu model (checking for the rope_embedder and image_index_embedding attributes), clones the model instance so the patch is isolated, then patches two things: the model's extra_conds hook, which intercepts the reference_rope_offsets that came through the conditioning, and the diffusion model's forward pass, which stores those offsets where the rope embedder will see them when it computes reference positions. Feed it a non-Boogu model and it politely returns it untouched - no patch, no crash, no complaint.
What this buys you in practice: instead of re-encoding the whole graph to move a reference, you nudge rope_x_offset/rope_y_offset (VAE-aligned, step of 8 pixels) and re-run. A character reference you want standing at frame-right instead of frame-left stops being a re-crop-and-pray exercise. That's the actual use case the README and node docs point at - regional editing where references are positioned, not just injected.
Fair warnings, because this is still young territory. The rope offsets do nothing unless this node is in the model path - the tooltip on the preparer says it in plain words: "Requires model EditApply node." And the whole thing assumes your Boogu build exposes those internals; if you're on an odd fork or a heavily quantized GGUF, the attribute checks can fail and you'll get an unpatched model back, which you'll notice as "my offsets did nothing." debug_log: true prints what the patch is doing to the console, which is the first thing to flip when that happens. Install: Manager → "EditUtils", or git clone https://github.com/lrzjason/ComfyUI-EditUtils into custom_nodes, restart. No extra dependencies.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| debug_logopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |