feat: enhance Comfy API handling and add tests for branded non-Z diffusion models

This commit is contained in:
syntaxbullet
2026-07-09 21:56:25 +02:00
parent c3a75cf0d6
commit 317a7bbf5f
11 changed files with 532 additions and 37 deletions

View File

@@ -106,7 +106,7 @@ function matches(data: ImageData, pixel: number, key: number[], tolerance: numbe
}
function postProcessSelection(selected: Uint8Array, width: number, height: number, settings: EditorState["tools"]["magicWand"]) {
let next = selectionToMaskValues(selected);
let next: Uint8ClampedArray = selectionToMaskValues(selected);
const despeckle = Math.round(Math.max(0, Math.min(20, settings.despeckle)));
const choke = Math.round(Math.max(-20, Math.min(20, settings.choke)));
const feather = Math.round(Math.max(0, Math.min(20, settings.feather)));

View File

@@ -3,7 +3,7 @@ import type { Dispatch } from "@commands/dispatcher";
import { commandIds } from "@commands/ids";
export function useCanvasResize(canvasRef: RefObject<HTMLCanvasElement | null>, dispatch: Dispatch) {
const lastSize = useRef<{ w: number; h: number }>();
const lastSize = useRef<{ w: number; h: number } | undefined>(undefined);
useEffect(() => {
const canvas = canvasRef.current;