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:
@@ -1,7 +1,7 @@
|
||||
import type { ImageDocument } from "@core/document";
|
||||
import type { Angle, Rect, Size, Transform, Vec2D } from "@core/geometry";
|
||||
import type { ArtboardId, AssetId, LayerId } from "@core/id";
|
||||
import type { GenerateSettings, ToolState } from "./tools";
|
||||
import type { ArtboardId, AssetId, GenerationCandidateId, GenerationJobId, LayerId } from "@core/id";
|
||||
import type { GenerateArchitecture, GenerateMode, GenerateSettings, ToolId, ToolState } from "./tools";
|
||||
import type { TransformSession } from "./transform";
|
||||
|
||||
export type ViewportState = {
|
||||
@@ -35,7 +35,7 @@ export type BrushStrokePreviewState = {
|
||||
};
|
||||
|
||||
export type GenerationCandidate = {
|
||||
id: string;
|
||||
id: GenerationCandidateId;
|
||||
source: string;
|
||||
mimeType: string;
|
||||
intrinsicSize: Size;
|
||||
@@ -81,28 +81,71 @@ export type GenerationCandidate = {
|
||||
|
||||
export type GenerationCompareMode = "result" | "before" | "split";
|
||||
|
||||
export type GenerationJobKind = "generate" | "regenerate" | "refine" | "replace";
|
||||
export type GenerationJobStatus = "running" | "succeeded" | "failed";
|
||||
|
||||
export type GenerationJob = {
|
||||
id: GenerationJobId;
|
||||
kind: GenerationJobKind;
|
||||
label: string;
|
||||
status: GenerationJobStatus;
|
||||
startedAt: number;
|
||||
finishedAt?: number;
|
||||
error?: string;
|
||||
};
|
||||
|
||||
export type GenerationState = {
|
||||
candidates: GenerationCandidate[];
|
||||
selectedCandidateId?: string;
|
||||
compareMode: GenerationCompareMode;
|
||||
jobs: GenerationJob[];
|
||||
resources: GenerationResourcesState;
|
||||
};
|
||||
|
||||
export type GenerationArchitectureOption = {
|
||||
value: GenerateArchitecture;
|
||||
label: string;
|
||||
defaultModel: string;
|
||||
models: string[];
|
||||
supportedModes: GenerateMode[];
|
||||
};
|
||||
|
||||
export type GenerationOptions = {
|
||||
architectures?: GenerationArchitectureOption[];
|
||||
models?: string[];
|
||||
textEncoders?: string[];
|
||||
vaes?: string[];
|
||||
samplers?: string[];
|
||||
schedulers?: string[];
|
||||
};
|
||||
|
||||
export type GenerationResourcesState = { status: "idle" | "loading" | "ready" | "failed"; options?: GenerationOptions; error?: string };
|
||||
|
||||
export type CommandPaletteState = {
|
||||
open: boolean;
|
||||
query: string;
|
||||
selectedIndex: number;
|
||||
};
|
||||
|
||||
export type WorkspacePanel = "none" | "generate" | "layers";
|
||||
|
||||
export type WorkspaceState = {
|
||||
panel: WorkspacePanel;
|
||||
previousNonGenerateTool: ToolId;
|
||||
};
|
||||
|
||||
export type EditorState = {
|
||||
viewport: ViewportState;
|
||||
selection: SelectionState;
|
||||
tools: ToolState;
|
||||
generation: GenerationState;
|
||||
commandPalette: CommandPaletteState;
|
||||
workspace: WorkspaceState;
|
||||
transformSession?: TransformSession;
|
||||
maskEdit?: MaskEditState;
|
||||
brushPreview?: BrushPreviewState;
|
||||
brushStrokePreview?: BrushStrokePreviewState;
|
||||
pointerSession?: { type: "pan" };
|
||||
};
|
||||
|
||||
export type HistorySnapshot = {
|
||||
|
||||
Reference in New Issue
Block a user