Nodes/AusBoss/Krea 2 Outpaint Model Patch πŸ†Ž
ComfyUI Node

Krea 2 Outpaint Model Patch πŸ†Ž

The node that tells Krea 2 where your image actually sits

By ausbossΒ·Created 2 months agoΒ·Updated 3 days agoΒ· 2
Krea 2 Outpaint Model Patch πŸ†Ž
  • model
  • stitcher
  • model
β—„kv_cachetrueβ–Ί
β—„placementsource rectangleβ–Ί

Here's the Krea 2 outpainting trap in one line: reference latents arrive with no position. The model sees your source image as a loose style hint and reinvents content around it instead of continuing it - you asked for more of the scene and got "in the style of the scene." Krea 2 Outpaint Model Patch πŸ†Ž is the missing piece: it registers the reference into the target grid at the exact rectangle the source occupies, so the outpaint actually extends the picture.

It reads that rectangle from the stitcher output of Load Image + Pad πŸ†Ž - the same stitcher that lets Stitch Inpaint πŸ†Ž restore pixels bit-identically. Load Image + Pad records where the source sits on the canvas; this patch tells the model. A stitcher without a placement (or a plain one) puts the reference over the full frame, which is the same "loose style hint" behavior you're trying to avoid.

Placement and inputs

Three inputs, all required: model (a Krea 2 model - patch it last, after any LoRA loaders), stitcher (from Load Image + Pad), and kv_cache (default true). That last one computes the reference's keys and values once per run instead of every sampling step - the reference doesn't change while sampling, so it's free speed. Turn it off only when you're debugging and want to rule the cache out.

One output: the patched MODEL, ready for the sampler. Place the node after any LoRA loader and before the sampler, and you're done.

The one-axis rule - read this before your first outpaint

The patch only places references that span a whole canvas axis. Pad left/right and the source spans the full height; pad top/bottom and it spans the full width. Pad both at once and the placement falls outside what the weights do - you get hard cuts at the old edge and mangled content in the new region. Do it in two runs instead: extend left/right, sample, then extend up/down.

A rounding sliver counts as breaking the rule. If canvas_multiple rounds the other axis up by even a few pixels, the source no longer spans it - lower the multiple or pick one that divides that dimension. When the node sees a placement that spans neither axis, it prints exactly this warning with the spare pixels on each axis, so it's not a silent failure - it's the clearest error message in the pack.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/ausboss/ComfyUI-AusBoss.git

Restart ComfyUI and search for AusBoss (Manager: ComfyUI-AusBoss). No extra Python dependencies; minimum ComfyUI 0.27.1.

Why it imports at runtime

This node patches comfy's flux attention internals, so it imports them when it runs rather than at startup. The practical consequence: if a ComfyUI update moves one of those internals, you get an error on this node instead of the whole pack silently disappearing from the menu. Annoying, but honest - a core change surfaces as a message, not as a missing node you spend an hour hunting for.

CategoryπŸ†Ž AusBoss/Krea2

Inputs (4)

NameTypeDefaultDescription
modelMODELA Krea 2 model. Patch last, after any LoRAs.
stitcherAUSBOSS_STITCHERFrom Load Image + Pad πŸ†Ž β€” supplies the rectangle the source occupies on the canvas. A stitcher without one places the reference over the full frame.
kv_cacheBOOLEANtrueCompute the reference's keys and values once per run instead of every step. The reference does not change while sampling, so this is free speed; turn it off only to rule the cache out when debugging.
placementoptCOMBOsource rectangleWhere the reference tokens are registered. 'source rectangle' pins the unpadded source to the rectangle the stitcher reports - the Registered Outpaint LoRA's contract, one padded axis per pass. 'whole canvas' spreads the reference over the full frame - for the AnyPaint LoRA, where the reference IS the padded canvas and the sampler's noise mask keeps the known pixels, so every side can be padded at once.

Outputs (1)

NameTypeDescription
modelMODELThe model with reference tokens registered into the canvas grid.