A native select draws its option list itself, so hovering a name gave nothing to go on: you picked by filename alone. Load Image + Pad, Load Video and the crop / rotate / pad editors now open a list that shows the hovered picture, or plays the hovered clip muted with its size and length, and filters as you type; arrow keys, Enter and Escape work. The picker (js/shared/media_picker.mjs) only reads the combo widget's options and writes the chosen value back, so saved workflows, undo and the API are unchanged. Pure parts live in media_list.mjs with tests.
3.5 KiB
Load Image + Pad
Loads an image and builds an outpaint canvas around it in one node. The canvas drawn on the node is the control: drag any edge of the dashed final rect to grow that side's padding — the whole edge is the handle, and corners grab the nearer edge. The second output is a mask covering exactly the padding, ready for an inpainter.
The widget card holds Source and Upload, Fill, Color or Backdrop, Feather, Multiple, and Budget. Exact padding opens a separate scrub row for each side. Every row can take a link; linked controls dim, and their values and links save with the workflow. The canvas remains available below the card for dragging the borders. Linked sides are controlled upstream; dragging their borders leaves the saved padding value unchanged.
The on-node canvas
- Each padded side shows its "+N px" count on the band; when the band is too thin to read, the label hops inside the image onto a pill.
- The badge in the corner is the truth: the final output size after the
canvas-multiple and megapixel math, exactly what the
width/heightoutputs will say. - Reset padding appears in the top-right corner while there is padding to clear; it sets every side a link does not drive back to 0.
- Clicks on empty canvas space fall through, so the node still drags.
- The hidden
pad_left/top/right/bottomwidgets hold the real values — the canvas is their remote control, so undo, save/load, and the API format all see plain INT widgets.
Guarantees
- The original pixels land bit-identical at their position (resized only when a megapixel target is set — and then resized before padding, so the mask seam stays one crisp pixel wide).
- The mask is
1.0over every padded pixel and0.0over the source, ramped only where feather says so.
Controls
- Source (
image): Choose or upload from ComfyUI's input folder; the list previews the image under the pointer and filters as you type. - Fill / Color / Backdrop (
mode/fill_color/backdrop_blur): Four fills —color,edge,edge pixel,pillarbox blur. Color shows forcolor, Backdrop forpillarbox blur. - feather: Ramps the mask inward across the image edge on each padded
side (ramp width capped by the image size), so the sampler blends the
seam.
0keeps the seam hard. The padding itself always stays solid. - Multiple (
canvas_multiple): The final canvas rounds up to this multiple; the remainder joins the right and bottom padding. - Budget (
target_megapixels):0= off. Rescales the source so the padded canvas lands on this many megapixels, then re-rounds to the multiple — the way to outpaint a small or huge image at a sampler-friendly size.
Outputs
- image: The padded canvas.
- mask: The outpaint mask (white = padding, feathered per
feather). - width / height: The final canvas size — the badge's numbers as INTs, for wiring into latent nodes.
- stitcher: Hand to Stitch Inpaint 🆎 with the sampled result to keep only the new padding and restore the original pixels bit-identically — whatever the sampler did inside the source area is discarded. It also records where the source sits on the canvas, which Krea 2 Outpaint Model Patch 🆎 reads to place the reference.
- reference: The source alone, no padding, fitted to a small multiple of 16 — the reference image for Krea 2 Encode 🆎 and other reference conditioning. It is built on every run; leave it unconnected when nothing needs it.