Seamless Border Kit Pixaroma
From a painted corner to a CSS border that scales
- image
- border_info
- kit
- corner
- top_strip
- side_strip
- frame_preview
- css
What it's for
You have a patterned border strip that repeats sideways, and one corner painted to match it. Now you want a frame: a box, a card, a panel, a whole web page edge, at whatever size the layout needs - without the frame's corners stretching into mush or the strips ending mid-motif.
That's a 9-slice problem, and it's been solved in CSS for years via border-image: one image split into nine regions, corners drawn as-is, edges tiled or stretched along the sides. Seamless Border Kit Pixaroma builds that image from your strip plus your corner, does the joins properly, and prints the CSS line so you can paste it into a page and get a border that grows correctly. It also gives you the frame as a picture, for when you want the PNG instead of the CSS.
How it builds the frame
It takes the top-left t × t square of the canvas as the corner, where t is the band thickness carried over on the border_info wire from Seamless Border Prep. If the canvas came back from an inpaint, the parts the mask never touched get restored to their exact pre-inpaint pixels - a VAE round trip softens everything slightly, and a corner that's a hair blurrier than the strips beside it is exactly the kind of thing you'd notice later.
Then it fades the corner's last few pixels into both strips. Both ramps reach 1 exactly on the join column and row, so the join equals the strip rather than approximating it - whatever the model painted in the middle, the edges don't lie. From there it's rotation: the corner turned 90° for each of the other three corners, the strip repeated along each side, background filled inside. One corner is all it needs, which is why the whole workflow only ever paints one.
The inputs and outputs
image is the inpainted canvas after VAE Decode. Prep's canvas wired straight in also works - you get a mitred frame with no model in the loop, which is a genuinely good result for geometric patterns and the fastest way to see whether the whole idea is going to work on your strip. A batch gives one kit per picture.
border_info must come from Seamless Border Prep; it's a custom wire type carrying the band, background colour and canvas size. blend (0–256, default 12) is how many pixels at the corner's two inner edges get faded into the strips. At 0 the painted corner is kept exactly as it came out and a slightly mismatched join can show. preview_repeats (1–12, default 3) is how many strip repeats go along each side of the frame preview - that preview is capped at 4096 px wide while the kit and pieces always keep full size, so a big preview can't eat your VRAM.
Six outputs. kit is the 9-slice image - save it, and this is the detail that matters, as border.png, because that's the filename the generated CSS points at. corner is the top-left corner on its own (turn it 90° clockwise per corner), top_strip is one repeat of the top band (turn 180° for the bottom), side_strip is the left side (turn 180° for the right), frame_preview is a whole frame to judge by eye, and css is the text you actually paste:
border-style: solid; border-width: 120px; border-image: url(border.png) 120 round;
The number is your band thickness in pixels, and round is what makes the edges tile a whole number of times instead of squashing the pattern. There's no fill, deliberately - the page's own background shows through the middle.
Where to use it
Card and panel frames on a website, a decorative page edge, a printed frame where you want a PNG at print resolution (Save Image Pixaroma does 300 ppi), or a game UI nine-slice - the kit output drops straight into Unity or Godot's slicing.
Install
One pack, one install:
cd ComfyUI/custom_nodes
git clone https://github.com/pixaroma/ComfyUI-Pixaroma
Restart ComfyUI, then press Ctrl+Shift+R in the browser - the refresh is what fixes "the node is there but its buttons aren't". ComfyUI Manager's search for Pixaroma stops at version 1.4.144 (the registry flagged the newer builds with no reason given), so use the Manager's nightly channel or git. Prep and Kit themselves are recent, so an old Manager install simply won't have them. No models, no downloads, and the pack's only pip requirement is imageio-ffmpeg for the video nodes.
Where people get burned
The most common one: feeding Kit something that isn't Prep's canvas - an upscaled result, a different workflow's decode. The node copes (it resizes to the canvas size) but warns in the console, because a non-square input gets stretched and a squashed corner is hard to unsee. Wire the inpainted canvas in, not the upscale.
Second: blend at 0 out of curiosity, then wondering why the corner doesn't sit flush. The fade is doing real work. Third: saving the kit under another name and then pasting the CSS, which then 404s on border.png. And remember Kit only ever builds one corner correctly per pass - if your pattern is directional, check the frame preview, because a motif that reads fine pointing one way can look upside down on the opposite side. If it does, your fix is upstream: change where the corner turns in Prep, or flip the band's outer edge.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The inpainted canvas after VAE Decode. A batch gives one kit per picture. Prep's canvas wired straight in gives a mitred corner. | |
| border_info | PIXAROMA_BORDER_INFO | From Seamless Border Prep. | |
| blend | INT | 120–256 | Pixels at the corner's two inner edges faded into the strips, so the joins match exactly. 0 = keep the painted corner as it is (the joins may show). |
| preview_repeats | INT | 31–12 | Strip repeats per side in the frame preview. The preview is made at most 4096 px wide; the kit and the pieces always keep full size. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| kit | IMAGE | 9-slice image: the four corners and one repeat of each side. Save it as border.png for the CSS line. |
| corner | IMAGE | The top-left corner. Turn it 90 degrees for each next corner, clockwise. |
| top_strip | IMAGE | The top strip, one repeat. Turn it 180 degrees for the bottom. |
| side_strip | IMAGE | The left side, one repeat. Turn it 180 degrees for the right side. |
| frame_preview | IMAGE | A whole frame, to check the joins by eye. |
| css | STRING | CSS for a box with this border, using the kit saved as border.png. |