LCM_outpaint_prep
Grow your canvas one side at a time
- image
- IMAGE
- IMAGE
Outpainting is just inpainting with the mask on the edge of the canvas - but somebody has to build that canvas and that mask, and LCM_outpaint_prep is that somebody. Feed it an image, pick a direction (left, right, top, bottom) and a size, and it returns two tensors: the image shifted and padded with black in that direction, plus a blurred mask covering the newly-added band. Those two outputs are exactly what the pack's inpaint generate nodes want as their image and mask inputs, so the prep node is the standard front half of every outpainting workflow in this pack.
It's a small, honest node and it works. There's no AI anywhere in it - just PIL geometry.
How it works
The outpaint function crops the original image by size pixels on the chosen side, pastes the crop at the opposite edge, and fills the gap with solid black. That's the "canvas" - black where the model needs to invent content. Then it draws a white rectangle over the newly-added band, plus a small growth margin of 30 pixels into the original image, and runs it through a GaussianBlur(10) so the mask edge feathers instead of ending in a hard line. A feathered mask is what keeps the new content from having a visible seam where it meets the old pixels.
So the returned pair is: shifted image (content pushed into the center, black band where you want to extend) and soft mask (white = region to regenerate, blurry edge = smooth blend).
The inputs that matter
Only three, and they're all in the name:
direction-left/right/top/bottom. Which edge to grow.size- how many pixels to add. Default 0 (yes, 0 - set it); the step is 64, so keep it in multiples of 64 to play nicely with the model's latent resolution.image- the input tensor.
Outputs: two IMAGEs - the shifted/padded image and the mask. Wire image → image, mask → mask on an inpaint generate node (with the loader's workflow set to outpaint mode). To extend further, chain the output image back through another LCM_outpaint_prep for the next side.
How to install it
It's in taabata/LCM_Inpaint-Outpaint_Comfy, installed with the rest of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/taabata/LCM_Inpaint-Outpaint_Comfy
cd LCM_Inpaint-Outpaint_Comfy
pip install -r requirements.txt
Or ComfyUI Manager → search "LCM_Inpaint_Outpaint_Comfy" → restart. No extra model downloads for this node - it needs no models at all.
Common issues
The mask's white region includes 30px of the original image by design, which means the model gets license to slightly repaint that edge. That's deliberate (it avoids a seam), but if you see the model creeping too far into your original content, it's this margin doing its job - and there's no knob to shrink it without editing the source. The blur radius is also fixed at 10.
Two practical notes: with size 0 it still runs, but the mask covers only the 30px growth band, which is almost never what you want - set a real size. And since the canvas grows in 64px steps, a size that isn't a multiple of 64 will generate at an off-latent resolution and can look slightly soft. Keep it on the grid.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| direction | COMBO | 4 options: left, right, top, bottom | |
| size | INT | 00–5000 | — |
| image | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| IMAGE | IMAGE | — |