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:
16
operations/generation/loadResources.ts
Normal file
16
operations/generation/loadResources.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { commandIds } from "@commands/ids";
|
||||
import type { AppStore } from "@editor/store";
|
||||
import { fetchGenerationOptions } from "@platform/comfy/generationClient";
|
||||
import type { GenerationOptions } from "@editor/state";
|
||||
|
||||
export async function loadGenerationResources(store: AppStore): Promise<void> {
|
||||
const current = store.getState().editor.generation.resources.status;
|
||||
if (current === "loading" || current === "ready") return;
|
||||
store.dispatch(commandIds.generationLoadResources, undefined);
|
||||
try {
|
||||
const options = await fetchGenerationOptions() as GenerationOptions;
|
||||
store.dispatch(commandIds.generationSetResources, { options });
|
||||
} catch (reason: unknown) {
|
||||
store.dispatch(commandIds.generationFailResources, { error: reason instanceof Error ? reason.message : "Unable to load ComfyUI models" });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user