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,4 +1,5 @@
|
||||
import type { Command } from "./command";
|
||||
import type { EditorState } from "@editor/state";
|
||||
import { commandIds } from "./ids";
|
||||
|
||||
export const historyUndoCommand: Command = {
|
||||
@@ -12,7 +13,7 @@ export const historyUndoCommand: Command = {
|
||||
return {
|
||||
...state,
|
||||
document: previous.document,
|
||||
editor: previous.editor,
|
||||
editor: preserveGenerationJobs(previous.editor, state.editor),
|
||||
history: {
|
||||
past: state.history.past.slice(0, -1),
|
||||
future: [{ document: state.document, editor: state.editor }, ...state.history.future],
|
||||
@@ -32,7 +33,7 @@ export const historyRedoCommand: Command = {
|
||||
return {
|
||||
...state,
|
||||
document: next.document,
|
||||
editor: next.editor,
|
||||
editor: preserveGenerationJobs(next.editor, state.editor),
|
||||
history: {
|
||||
past: [...state.history.past, { document: state.document, editor: state.editor }],
|
||||
future: state.history.future.slice(1),
|
||||
@@ -42,3 +43,13 @@ export const historyRedoCommand: Command = {
|
||||
};
|
||||
|
||||
export const historyCommands = [historyUndoCommand, historyRedoCommand] satisfies Command<unknown>[];
|
||||
|
||||
function preserveGenerationJobs(target: EditorState, current: EditorState): EditorState {
|
||||
return {
|
||||
...target,
|
||||
generation: {
|
||||
...target.generation,
|
||||
jobs: current.generation.jobs,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user