- 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.
51 lines
1.0 KiB
TypeScript
51 lines
1.0 KiB
TypeScript
import type { AppState, EditorState } from "./state";
|
|
import { initialToolState } from "./tools";
|
|
|
|
export const initialEditorState: EditorState = {
|
|
viewport: {
|
|
center: { x: 0, y: 0 },
|
|
zoom: 1,
|
|
rotation: 0,
|
|
size: { w: 0, h: 0 },
|
|
},
|
|
selection: {
|
|
layerIds: [],
|
|
},
|
|
tools: initialToolState,
|
|
generation: {
|
|
candidates: [],
|
|
selectedCandidateId: undefined,
|
|
compareMode: "result",
|
|
jobs: [],
|
|
resources: { status: "idle" },
|
|
},
|
|
commandPalette: {
|
|
open: false,
|
|
query: "",
|
|
selectedIndex: 0,
|
|
},
|
|
workspace: {
|
|
panel: "none",
|
|
previousNonGenerateTool: "select",
|
|
},
|
|
transformSession: undefined,
|
|
maskEdit: undefined,
|
|
brushPreview: undefined,
|
|
brushStrokePreview: undefined,
|
|
pointerSession: undefined,
|
|
};
|
|
|
|
export function createInitialAppState(name = "Untitled"): AppState {
|
|
return {
|
|
document: {
|
|
id: crypto.randomUUID(),
|
|
name,
|
|
version: 1,
|
|
artboards: [],
|
|
assets: [],
|
|
},
|
|
editor: initialEditorState,
|
|
history: { past: [], future: [] },
|
|
};
|
|
}
|