Zoey - 框选裁剪/外扩
Drag a frame to crop or extend your canvas — the outpainting prep node with fill color and feathering
- image
- 输出图像
ZoeyOutpaintFrame is the spatial-precision node for the two jobs nobody wants to do with math: cropping to a drawn box, and expanding a canvas outward so you can outpaint into it. You drag a frame over your image in the node body - pull the edges inside the image and it crops; pull them past the borders and it grows the canvas into gray, ready for an inpaint/outpaint pass to fill. That "prepare the region" step is the part of outpainting workflows people improvise with a dozen math nodes and get wrong; this makes it a visual, reproducible setting.
It comes from comfyui-ZoeyTool (Zoey Tool/图像处理), whose sibling nodes (mask drawing, light handles, multi-canvas) share the same interactive-framing approach. The workflow it feeds is standard outpainting: expand the canvas here → send the image plus a mask of the empty region to an inpaint sampler → done.
How it works
Your drag is translated into four normalized frame values - frame_left, frame_top, frame_right, frame_bottom - where 0–1 spans the original image and values below 0 or above 1 push the frame outside it (defaults start you at -0.1 … 1.1, a slight outward margin). The node then builds a new canvas of whatever size the frame defines, pastes the source image at its position, and fills every added pixel with 填充颜色 (a hex color, default mid-gray #808080 - the classic inpaint-neutral).
The inputs that matter when you're aiming for usable outpainting:
fill_mode- on (default), and when the frame sits inside the image, the boxed-off exterior is filled and the output stays the original image size (a fill-and-crop); when the frame extends beyond, you get the bigger canvas. Off, and the output is exactly the frame's dimensions with the image pasted inside - pure reframe.feather- blurs/blends the seam where image meets fill (0–200 px), so your inpaint mask region has a soft edge instead of a hard cutoff.ratio_mode+target_ratio- snaps the canvas to a fixed aspect (16:9, 9:16, 1:1, 21:9…), keeping the frame centered while it adjusts. Handy when the destination needs a specific aspect and you don't care exactly how much you outpainted on each side.
The output is 输出图像 - the new, framed canvas. From there, the standard move is to build a mask of the gray/fill area and feed both into your inpaint sampler.
Installing it
comfyui-ZoeyTool, as with the rest of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/liangzoey/comfyui-ZoeyTool.git
cd comfyui-ZoeyTool
pip install -r requirements.txt
Restart ComfyUI (or ComfyUI Manager → comfyui-ZoeyTool). Pure tensor work - no downloads, no models.
Where people get burned
The fill-color default being gray rather than the image's true edge color means a wide outpaint shows a visible gray border in your preview; that's normal - the inpaint is supposed to paint over it, so match the mask to the filled region and don't expect the fill itself to look finished. Second, fill_mode's behavior differs inside vs outside the image - "on + inside frame" keeps original dimensions, "on + outside frame" expands. It reads as inconsistent until you remember the frame defines a region, not a crop mode. Third, values are clamped per-side but wildly asymmetric frames (drag far past one edge) can produce enormous canvases that your VRAM will quietly hate during the inpaint pass - keep expansions modest unless you're on a big card.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| frame_left | FLOAT | -0.100-5–1 | — |
| frame_top | FLOAT | -0.100-5–1 | — |
| frame_right | FLOAT | 1.1000–5 | — |
| frame_bottom | FLOAT | 1.1000–5 | — |
| 填充颜色 | STRING | #808080 | — |
| fill_mode | BOOLEAN | true | — |
| feather | INT | 00–200 | — |
| ratio_mode | BOOLEAN | false | — |
| target_ratio | COMBO | 16:9 | 8 options: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, +2 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 输出图像 | IMAGE | — |