- 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.
37 lines
1.6 KiB
TypeScript
37 lines
1.6 KiB
TypeScript
import { documentCommands } from "@commands/document";
|
|
import { generationCommands } from "@commands/generation";
|
|
import { historyCommands } from "@commands/history";
|
|
import { commandIds } from "@commands/ids";
|
|
import { commandPaletteCommands } from "@commands/palette";
|
|
import { createCommandRegistry } from "@commands/registry";
|
|
import { selectionCommands } from "@commands/selection";
|
|
import { toolCommands } from "@commands/tool";
|
|
import { transformCommands } from "@commands/transform";
|
|
import { viewportCommands } from "@commands/viewport";
|
|
import { workspaceCommands } from "@commands/workspace";
|
|
import { editorCommands } from "@commands/editor";
|
|
import { createInitialAppState } from "@editor/initial-state";
|
|
import { createAppStore } from "@editor/store";
|
|
|
|
export type ImageStudioApp = ReturnType<typeof createImageStudioApp>;
|
|
|
|
export function createImageStudioApp(options?: { documentName?: string; createDefaultArtboard?: boolean }) {
|
|
const registry = createCommandRegistry([...viewportCommands, ...selectionCommands, ...documentCommands, ...toolCommands, ...generationCommands, ...transformCommands, ...historyCommands, ...commandPaletteCommands, ...workspaceCommands, ...editorCommands]);
|
|
const store = createAppStore(createInitialAppState(options?.documentName), registry);
|
|
|
|
if (options?.createDefaultArtboard !== false) {
|
|
const artboardId = crypto.randomUUID();
|
|
store.dispatch(commandIds.documentAddArtboard, {
|
|
id: artboardId,
|
|
name: "Artboard 1",
|
|
bounds: { x: -400, y: -300, w: 800, h: 600 },
|
|
});
|
|
store.dispatch(commandIds.viewportFitArtboard, { artboardId });
|
|
}
|
|
|
|
return {
|
|
registry,
|
|
store,
|
|
};
|
|
}
|