feat: add ComfyUI integration for image generation and management

- Implemented ComfyGenerateRequest type and associated functions for generating images using various architectures and modes.
- Added functions for listing generation options and handling image uploads.
- Created workflows for different generation modes including SDXL, Z-Image, Z-Image Turbo, and Anima.
- Introduced GenerationJobStatus component to display the status of ongoing generation jobs.
- Developed MaskControls for managing mask operations and displaying mask analysis.
- Created palette items for tool selection, layer management, and generation settings.
This commit is contained in:
syntaxbullet
2026-07-10 23:15:02 +02:00
parent 41bbd1e16b
commit 5e4b548ad4
80 changed files with 2114 additions and 1954 deletions

View File

@@ -1,4 +1,4 @@
import { useEffect, useRef, useState, type RefObject } from "react";
import { useEffect, useRef, type RefObject } from "react";
import { commandIds } from "@commands/ids";
import type { AppStore } from "@editor/store";
import { isPanInteractionMode } from "@editor/tools";
@@ -12,8 +12,8 @@ import {
pointerInputEventFromPointerEvent,
wheelInputEventFromWheelEvent,
} from "@input/index";
import { beginBrushSession, canPreviewBrush, cancelBrushSession, commitBrushSession, updateBrushSession, type BrushSession } from "./brush";
import { applyMagicWandAt } from "./magic-wand";
import { beginBrushSession, canPreviewBrush, cancelBrushSession, commitBrushSession, updateBrushSession, type BrushSession } from "@operations/paint/brush";
import { applyMagicWandAt } from "@operations/masks/magic-wand";
export type CanvasInputOptions = {
globalKeybindConsumer: GlobalKeybindConsumer;
@@ -21,16 +21,11 @@ export type CanvasInputOptions = {
globalWheelConsumer: GlobalWheelConsumer;
};
export type CanvasInputState = {
isPanning: boolean;
};
export function useCanvasInput(
canvasRef: RefObject<HTMLCanvasElement | null>,
store: AppStore,
options: CanvasInputOptions,
): CanvasInputState {
const [isPanning, setIsPanning] = useState(false);
) {
const brushSession = useRef<BrushSession | undefined>(undefined);
const brushSessionId = useRef(0);
@@ -115,7 +110,7 @@ export function useCanvasInput(
if (consumed) {
clearBrushPreview();
canvas.setPointerCapture(event.pointerId);
setIsPanning(true);
store.dispatch(commandIds.editorSetPointerSession, { type: "pan" });
event.preventDefault();
return;
}
@@ -203,7 +198,7 @@ export function useCanvasInput(
const consumed = panHandler.pointerUp(inputEvent);
if (!consumed) return;
setIsPanning(false);
store.dispatch(commandIds.editorSetPointerSession, undefined);
clearBrushPreview();
event.preventDefault();
};
@@ -250,7 +245,6 @@ export function useCanvasInput(
};
}, [canvasRef, options, store]);
return { isPanning };
}
function isEditableKeyboardTarget(target: EventTarget | null) {