Compare commits
3
Commits
main
...
release/2.27.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b33e7be2d3 | ||
|
|
e99e31c4b6 | ||
|
|
ea63fc3ac2 |
+8
-1
@@ -2,7 +2,14 @@
|
||||
|
||||
All notable changes to ComfyUI-AusBoss are documented here.
|
||||
|
||||
## Unreleased
|
||||
## 2.27.0 - 2026-11-19
|
||||
|
||||
- **Image Crop + Rotate + Pad can give back your picture's exact size.**
|
||||
Its megapixel resize rounds each side to the step the model needs, so a
|
||||
1920x1080 picture came back as 1920x1088 after an edit. Two new outputs,
|
||||
**canvas_width** and **canvas_height**, hold the size before that
|
||||
rounding. Wire them to Image Resize after the model to get the result
|
||||
back at 1920x1080. Saved workflows are unchanged.
|
||||
|
||||
- **Box edits on big photos start much sooner.** Crop For Inpaint,
|
||||
Image Crop + Rotate + Pad and Stitch Inpaint grew and softened their
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="105" height="20" role="img" aria-label="release: v2.26.4">
|
||||
<title>release: v2.26.4</title>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="105" height="20" role="img" aria-label="release: v2.27.0">
|
||||
<title>release: v2.27.0</title>
|
||||
<path fill="#555" d="M0 0h48v20H0z"/>
|
||||
<path fill="#00b4aa" d="M48 0h57v20H48z"/>
|
||||
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
||||
<text x="24" y="14">release</text>
|
||||
<text x="76.5" y="14">v2.26.4</text>
|
||||
<text x="76.5" y="14">v2.27.0</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 425 B After Width: | Height: | Size: 425 B |
@@ -191,6 +191,10 @@ to every Image Crop + Rotate + Pad in this browser.
|
||||
is on keep).
|
||||
- **width** / **height**: The output size after the transform and any resize.
|
||||
- **prompt_image**: The image again, with see-through parts shown as white instead of the fill colour. Wire it to whatever writes your prompt. It is the same as **image** for a picture with no see-through parts, and when **Painted area** is on keep.
|
||||
- **canvas_width** / **canvas_height**: The size of your picture after rotate, crop and
|
||||
padding, before **Resize** changes it. Wire both to Image Resize after the
|
||||
model to get the result back at that exact size: a 1920x1080 picture that the
|
||||
resize rounds to 1920x1088 comes back as 1920x1080.
|
||||
|
||||
## See-through pictures
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import { app } from "../../../scripts/app.js";
|
||||
// Must match `version` in pyproject.toml — scripts/release_preflight.py
|
||||
// enforces it. The backend serves its copy at /ausboss/pack_version; a
|
||||
// mismatch means the browser cached JavaScript from an older install.
|
||||
export const AUSBOSS_JS_VERSION = "2.26.4";
|
||||
export const AUSBOSS_JS_VERSION = "2.27.0";
|
||||
|
||||
export const BRAND = "#00b4aa"; // AusBoss teal — keep node accents consistent.
|
||||
export const BRAND_DARK = "#007f78";
|
||||
|
||||
@@ -383,6 +383,12 @@
|
||||
},
|
||||
"6": {
|
||||
"name": "提示图像"
|
||||
},
|
||||
"7": {
|
||||
"name": "画布宽度"
|
||||
},
|
||||
"8": {
|
||||
"name": "画布高度"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -93,8 +93,11 @@ class AusBossImageCropRotatePad:
|
||||
return {"required": required, "optional": optional}
|
||||
|
||||
# Appended outputs only: saved links ride slot indices.
|
||||
RETURN_TYPES = ("IMAGE", "MASK", "AUSBOSS_STITCHER", "IMAGE", "INT", "INT", "IMAGE")
|
||||
RETURN_NAMES = ("image", "mask", "stitcher", "original", "width", "height", "prompt_image")
|
||||
RETURN_TYPES = ("IMAGE", "MASK", "AUSBOSS_STITCHER", "IMAGE", "INT", "INT", "IMAGE", "INT", "INT")
|
||||
RETURN_NAMES = (
|
||||
"image", "mask", "stitcher", "original", "width", "height", "prompt_image",
|
||||
"canvas_width", "canvas_height",
|
||||
)
|
||||
OUTPUT_TOOLTIPS = (
|
||||
"The transformed image batch in BHWC format.",
|
||||
"White where the model paints: padding, the corners a turn leaves empty, "
|
||||
@@ -107,6 +110,9 @@ class AusBossImageCropRotatePad:
|
||||
"The image with see-through parts shown on white instead of the fill. Wire it to "
|
||||
"the node that writes your prompt, so a cutout gets a real backdrop. The same "
|
||||
"as image when your picture has no see-through parts, or painted_area keeps the picture.",
|
||||
"Width of your picture after any rotate, crop and padding, before the megapixel resize. "
|
||||
"Wire it to Image Resize to get the result back at this size.",
|
||||
"Height of your picture after any rotate, crop and padding, before the megapixel resize.",
|
||||
)
|
||||
FUNCTION = "load_transform"
|
||||
|
||||
@@ -129,6 +135,9 @@ class AusBossImageCropRotatePad:
|
||||
output, mask, geometry, prompt_image = transform_pil_batch(
|
||||
frames, spec, view=True, keep_see_through=keep_picture
|
||||
)
|
||||
# The size before the budget rounds it to resolution_steps: what a
|
||||
# result is put back to when the picture must keep its own size.
|
||||
canvas_width, canvas_height = int(output.shape[2]), int(output.shape[1])
|
||||
if resize_to_megapixels:
|
||||
output, mask, prompt_image = resize_then_pad(
|
||||
output, mask, geometry, spec.fill_color, float(megapixels), str(resize_method),
|
||||
@@ -154,6 +163,7 @@ class AusBossImageCropRotatePad:
|
||||
return (
|
||||
output, mask, stitcher, original,
|
||||
int(output.shape[2]), int(output.shape[1]), prompt_image,
|
||||
canvas_width, canvas_height,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ name = "ausboss-nodes"
|
||||
# Manager/registry search matches against this text, so it names the actual
|
||||
# nodes instead of describing the collection abstractly.
|
||||
description = "ComfyUI-AusBoss (AusBoss nodes): image and video nodes with compact controls: Image and Video Crop + Rotate + Pad (frame or clip), Load Image, Load Image + Pad, Image Folder, Image Resize, Align Image, Image Size, Color Match, Image Compare A/B, Realign to Source (experimental), Save Image (PNG, WebP/JXL, captions), Load Video, Load Audio, Save Video, Select Frame, Frame Interpolate, Mask Refine, Mask by Name and Mask by Touch, LaMa Inpaint, Crop For Inpaint, Stitch Inpaint, Tiled Upscale and Tiled Upscale Stitch, FlashVSR Upscale, Edit Lock and Edit Lock Restore, LoRA Loader, Krea 2 Encode and Outpaint Model Patch, Latent Size, Layout Boxes, Seed, Select Every Nth, Split Batch, Merge Batches, Text, Text Lines, Prompt Variations, H3 Prompt Writer, Integer, Float, Math Expression, Show Text, Free Memory, Workflow Note, Workflow Note Tile, Callout, Callout Tile, Workflow Switches, Run Timer, and Step Preview. Example workflows for Qwen Image 2.1, Krea 2, Klein 9B and LTX 2.3."
|
||||
version = "2.26.4"
|
||||
version = "2.27.0"
|
||||
# comfy-cli serializes this to JSON verbatim, so `file` publishes the literal
|
||||
# string {"file": "LICENSE"} to the registry listing. `text` puts a readable
|
||||
# name there instead. Both forms are supported; the LICENSE file is unchanged.
|
||||
|
||||
Vendored
+8
@@ -366,6 +366,14 @@
|
||||
[
|
||||
"IMAGE",
|
||||
"prompt_image"
|
||||
],
|
||||
[
|
||||
"INT",
|
||||
"canvas_width"
|
||||
],
|
||||
[
|
||||
"INT",
|
||||
"canvas_height"
|
||||
]
|
||||
]
|
||||
},
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
"""A result can come back at the picture's own size.
|
||||
|
||||
Image Crop + Rotate + Pad rounds a megapixel resize to resolution_steps, so a
|
||||
1920x1080 picture reaches Qwen as 1920x1088 and the result is 1920x1088. The
|
||||
node's canvas_width and canvas_height outputs hold the size before that
|
||||
rounding; wired to Image Resize (width+height, stretch) they put the result
|
||||
back at exactly that size.
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from PIL import Image
|
||||
import torch
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
||||
if os.environ.get("AUSBOSS_COMFY_ROOT"):
|
||||
sys.path.append(os.environ["AUSBOSS_COMFY_ROOT"])
|
||||
from nodes.node_image_crop_rotate_pad import AusBossImageCropRotatePad
|
||||
from nodes.node_image_resize import AusBossImageResize
|
||||
|
||||
SIZES = [(1920, 1080), (1080, 1920), (1000, 563), (1366, 768), (1281, 721), (2048, 1152)]
|
||||
|
||||
|
||||
def load(width, height, **values):
|
||||
frame = Image.new("RGB", (width, height), (90, 120, 150))
|
||||
with patch("nodes.node_image_crop_rotate_pad.resolve_input_path", return_value=Path("s.png")), patch(
|
||||
"nodes.node_image_crop_rotate_pad.load_image_frames", return_value=[frame]
|
||||
):
|
||||
return AusBossImageCropRotatePad().load_transform(
|
||||
"s.png", resize_to_megapixels=True, megapixels=2.0, resolution_steps=32, **values
|
||||
)
|
||||
|
||||
|
||||
@unittest.skipUnless(os.environ.get("AUSBOSS_COMFY_ROOT"), "Set AUSBOSS_COMFY_ROOT for core resize integration")
|
||||
class CanvasSizeTests(unittest.TestCase):
|
||||
def test_the_report_1920x1080_is_rounded_to_1088_by_the_budget(self):
|
||||
out = load(1920, 1080)
|
||||
self.assertEqual((out[4], out[5]), (1920, 1088))
|
||||
|
||||
def test_canvas_outputs_are_the_size_before_the_budget(self):
|
||||
for width, height in SIZES:
|
||||
with self.subTest(size=(width, height)):
|
||||
out = load(width, height)
|
||||
self.assertEqual((out[7], out[8]), (width, height))
|
||||
|
||||
def test_canvas_outputs_follow_a_crop_and_padding(self):
|
||||
out = load(400, 300, crop_x=10, crop_y=10, crop_width=200, crop_height=101, pad_left=5, pad_right=6)
|
||||
self.assertEqual((out[7], out[8]), (211, 101))
|
||||
|
||||
def test_a_result_comes_back_at_the_exact_size(self):
|
||||
for width, height in SIZES:
|
||||
with self.subTest(size=(width, height)):
|
||||
out = load(width, height)
|
||||
result = out[0] # stands in for the model's picture at the same size
|
||||
back = AusBossImageResize().resize(
|
||||
result, "width+height", out[7], out[8], 1024, 1.0, 1.0, "stretch", "#000000", 1, "lanczos"
|
||||
)[0]
|
||||
self.assertEqual(tuple(back.shape[1:3]), (height, width))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -156,7 +156,7 @@ class TransformOutputTests(unittest.TestCase):
|
||||
outputs = AusBossImageCropRotatePad().load_transform('source.png', pad_left=32, feather=0)
|
||||
self.assert_outputs(outputs)
|
||||
# prompt_image, appended last: the image itself for an opaque picture.
|
||||
self.assertEqual(len(outputs), 7)
|
||||
self.assertEqual(len(outputs), 9)
|
||||
self.assertTrue(torch.equal(outputs[6], outputs[0]))
|
||||
self.assertIsNot(outputs[6], outputs[0])
|
||||
|
||||
@@ -176,7 +176,7 @@ class TransformOutputTests(unittest.TestCase):
|
||||
@unittest.skipUnless(COMFY_ROOT, "Set AUSBOSS_COMFY_ROOT for core resize integration")
|
||||
def test_stitcher_uses_resized_canvas_dimensions(self):
|
||||
with patch('nodes.node_image_crop_rotate_pad.resolve_input_path', return_value=Path('source.png')), patch('nodes.node_image_crop_rotate_pad.load_image_frames', return_value=[self.source]):
|
||||
image, mask, stitcher, original, width, height, _ = AusBossImageCropRotatePad().load_transform('source.png', pad_left=32, feather=0, resize_to_megapixels=True, megapixels=.05, resolution_steps=16)
|
||||
image, mask, stitcher, original, width, height, _, *rest = AusBossImageCropRotatePad().load_transform('source.png', pad_left=32, feather=0, resize_to_megapixels=True, megapixels=.05, resolution_steps=16)
|
||||
self.assertEqual((width, height), (int(image.shape[2]), int(image.shape[1])))
|
||||
self.assertEqual(tuple(stitcher['canvas'].shape), tuple(image.shape))
|
||||
self.assertEqual(tuple(original.shape), (1, 96, 128, 3))
|
||||
|
||||
@@ -156,7 +156,7 @@ class OpaqueIdentityTests(unittest.TestCase):
|
||||
for source_name, source in opaque_sources():
|
||||
for layout_name, layout in LAYOUTS.items():
|
||||
with self.subTest(source=source_name, layout=layout_name):
|
||||
image, mask, stitcher, original, width, height, prompt_image = run_node(source, **layout)
|
||||
image, mask, stitcher, original, width, height, prompt_image, *_ = run_node(source, **layout)
|
||||
spec = TransformSpec(**{k: v for k, v in layout.items() if not k.startswith("stitch")})
|
||||
old_output, old_mask, geometry = reference_transform(source, spec)
|
||||
old_image, old_mask = as_tensor(old_output), as_tensor(old_mask)
|
||||
@@ -231,7 +231,7 @@ class SeeThroughRuleTests(unittest.TestCase):
|
||||
alpha = np.zeros((8, 10), np.uint8)
|
||||
alpha[:, 5:] = 255
|
||||
alpha[0, :5] = (10, 100, 200, 229, 230) # the last one is kept
|
||||
image, mask, _, _, _, _, _ = run_node(cutout(10, 8, alpha), feather=0)
|
||||
image, mask, *_ = run_node(cutout(10, 8, alpha), feather=0)
|
||||
see_through = torch.from_numpy(alpha < 230)
|
||||
fill = torch.tensor(fill_rgb("#808080"), dtype=torch.float32) / 255
|
||||
self.assertTrue(torch.equal(image[0][see_through], fill.expand(int(see_through.sum()), 3)))
|
||||
@@ -311,7 +311,7 @@ class SeeThroughRuleTests(unittest.TestCase):
|
||||
yy, xx = np.mgrid[:80, :100]
|
||||
hole = (yy - 40) ** 2 / 15**2 + (xx - 50) ** 2 / 22**2 <= 1
|
||||
alpha[hole] = 0
|
||||
image, mask, stitcher, original, _, _, prompt_image = run_node(cutout(100, 80, alpha), feather=6, stitch_blend=4)
|
||||
image, mask, stitcher, original, _, _, prompt_image, *_ = run_node(cutout(100, 80, alpha), feather=6, stitch_blend=4)
|
||||
hole_t = torch.from_numpy(hole)
|
||||
self.assertTrue(bool((mask[0][hole_t] == 1).all()))
|
||||
self.assertTrue(bool((prompt_image[0][hole_t] == 1).all()))
|
||||
@@ -332,7 +332,7 @@ class SeeThroughRuleTests(unittest.TestCase):
|
||||
|
||||
def test_a_turned_cutout_marks_both_kinds_of_empty(self):
|
||||
source = cutout()
|
||||
image, mask, stitcher, original, width, height, prompt_image = run_node(
|
||||
image, mask, stitcher, original, width, height, prompt_image, *_ = run_node(
|
||||
source, rotation_degrees=17, pad_left=30, pad_right=30, feather=0
|
||||
)
|
||||
fill = torch.tensor(fill_rgb("#808080"), dtype=torch.float32) / 255
|
||||
@@ -358,7 +358,7 @@ class SeeThroughRuleTests(unittest.TestCase):
|
||||
def test_a_picture_faded_throughout_is_kept_whole(self):
|
||||
alpha = np.full((40, 60), 128, np.uint8)
|
||||
alpha[:, :4] = 0
|
||||
image, mask, _, original, _, _, prompt_image = run_node(cutout(60, 40, alpha), feather=0)
|
||||
image, mask, _, original, _, _, prompt_image, *_ = run_node(cutout(60, 40, alpha), feather=0)
|
||||
self.assertTrue(bool((mask[0][:, 4:] == 0).all()))
|
||||
self.assertTrue(bool((mask[0][:, :4] == 1).all()))
|
||||
green = torch.tensor(GREEN, dtype=torch.float32) / 255
|
||||
@@ -367,7 +367,7 @@ class SeeThroughRuleTests(unittest.TestCase):
|
||||
self.assertTrue(bool((original[0][:, :4] == 1).all()))
|
||||
|
||||
def test_a_fully_see_through_picture_is_all_paint(self):
|
||||
image, mask, stitcher, original, _, _, prompt_image = run_node(cutout(30, 20, np.zeros((20, 30), np.uint8)), pad_left=10)
|
||||
image, mask, stitcher, original, _, _, prompt_image, *_ = run_node(cutout(30, 20, np.zeros((20, 30), np.uint8)), pad_left=10)
|
||||
self.assertTrue(bool((mask == 1).all()))
|
||||
fill = torch.tensor(fill_rgb("#808080"), dtype=torch.float32) / 255
|
||||
self.assertTrue(torch.equal(image[0], fill.expand(20, 40, 3)))
|
||||
@@ -381,7 +381,7 @@ class SeeThroughRuleTests(unittest.TestCase):
|
||||
solid = Image.new("RGBA", (40, 30), (*GREEN, 255))
|
||||
alpha = np.full((30, 40), 255, np.uint8)
|
||||
alpha[:, :10] = 0
|
||||
image, mask, _, original, _, _, prompt_image = run_node(solid, solid, cutout(40, 30, alpha), pad_left=8)
|
||||
image, mask, _, original, _, _, prompt_image, *_ = run_node(solid, solid, cutout(40, 30, alpha), pad_left=8)
|
||||
self.assertTrue(torch.equal(prompt_image[0], image[0]))
|
||||
self.assertTrue(bool((prompt_image[1][:, 8:18] == 1).all()))
|
||||
self.assertTrue(bool((mask[1][:, 8:18] == 1).all()))
|
||||
@@ -400,7 +400,7 @@ class SeeThroughRuleTests(unittest.TestCase):
|
||||
alpha = np.full((96, 128), 255, np.uint8)
|
||||
alpha[:, :40] = 0
|
||||
source = cutout(128, 96, alpha)
|
||||
image, mask, _, _, width, height, prompt_image = run_node(
|
||||
image, mask, _, _, width, height, prompt_image, *_ = run_node(
|
||||
source, pad_right=32, resize_to_megapixels=True, megapixels=0.03, resolution_steps=8
|
||||
)
|
||||
self.assertEqual(tuple(prompt_image.shape), tuple(image.shape))
|
||||
|
||||
Reference in New Issue
Block a user