diff --git a/WebUI/src/assets/i18n/en-US.json b/WebUI/src/assets/i18n/en-US.json index 4feb0432..e6d5f2b4 100644 --- a/WebUI/src/assets/i18n/en-US.json +++ b/WebUI/src/assets/i18n/en-US.json @@ -242,5 +242,7 @@ "WORKFLOW_HIGH_VRAM_INFO": "This model requires a lot of VRAM. Reduce the resolution and/or restart the ComfyUI backend when in case you experience a poor performance.", "WORKFLOW_HIGH_VRAM_WARNING": "high VRAM required", "LOADING_VERIFYING_BACKENDS": "Verifying backends", - "LOADING_AI_PLAYGROUND_LOADING": "AI Playground Loading" + "LOADING_AI_PLAYGROUND_LOADING": "AI Playground Loading", + + "COM_RESET": "Reset" } diff --git a/WebUI/src/assets/js/store/comfyUi.ts b/WebUI/src/assets/js/store/comfyUi.ts index 95e46af9..25d6f243 100644 --- a/WebUI/src/assets/js/store/comfyUi.ts +++ b/WebUI/src/assets/js/store/comfyUi.ts @@ -201,7 +201,6 @@ export const useComfyUi = defineStore( ) generateIdx.value++ }) - console.log('!!!!!!!!!!!!!!!', { detail: msg }) console.log('executed', { detail: msg.data }) break case 'execution_start': diff --git a/WebUI/src/assets/js/store/imageGeneration.ts b/WebUI/src/assets/js/store/imageGeneration.ts index 16e4795c..6c193b29 100644 --- a/WebUI/src/assets/js/store/imageGeneration.ts +++ b/WebUI/src/assets/js/store/imageGeneration.ts @@ -6,6 +6,7 @@ import { useI18N } from './i18n' import * as Const from '../const' import { useGlobalSetup } from './globalSetup' import * as toast from '@/assets/js/toast.ts' +import { preview } from 'vite' export type StableDiffusionSettings = { resolution: 'standard' | 'hd' | 'manual' // ~ modelSettings.resolution 0, 1, 3 @@ -117,6 +118,7 @@ const ComfyNumberInputSchema = z.object({ step: z.number(), }) export type ComfyNumberInput = z.infer + const ComfyImageInputSchema = z.object({ nodeTitle: z.string(), nodeInput: z.string(), @@ -592,7 +594,6 @@ export const useImageGeneration = defineStore( }) const generatedImages = ref([]) - const imageUrls = ref([]) const currentState = ref('no_start') const stepText = ref('') const previewIdx = ref(0) @@ -767,12 +768,22 @@ export const useImageGeneration = defineStore( comfyUi.stop() } + function deleteImage(id: number | undefined) { + if (id !== undefined) { + let index = generatedImages.value.findIndex((item) => item.id === id) + generatedImages.value.splice(index, 1) + if (index === generatedImages.value.length && index !== 0) { + index-- + } + previewIdx.value = generatedImages.value[index].id + } + } + function reset() { + generatedImages.value.length = 0 currentState.value = 'no_start' - stableDiffusion.generateParams.length = 0 - imageUrls.value.length = 0 - generatedImages.value.length = 0 //new - previewIdx.value = -1 + stepText.value = '' + previewIdx.value = 0 } loadWorkflowsFromJson() @@ -786,7 +797,6 @@ export const useImageGeneration = defineStore( processing, prompt, generatedImages, - imageUrls, currentState, stepText, stopping, @@ -815,6 +825,7 @@ export const useImageGeneration = defineStore( updateImage, generate, stopGeneration, + deleteImage, reset, } }, diff --git a/WebUI/src/assets/js/store/stableDiffusion.ts b/WebUI/src/assets/js/store/stableDiffusion.ts index 9f9be25a..8e2d6205 100644 --- a/WebUI/src/assets/js/store/stableDiffusion.ts +++ b/WebUI/src/assets/js/store/stableDiffusion.ts @@ -35,7 +35,6 @@ export const useStableDiffusion = defineStore( const models = useModels() let abortController: AbortController | null - const generateParams = ref(new Array()) async function generate() { if (imageGeneration.processing) { @@ -196,7 +195,6 @@ export const useStableDiffusion = defineStore( } return { - generateParams, generate, stop, } diff --git a/WebUI/src/components/PaintInfo.vue b/WebUI/src/components/PaintInfo.vue index 227f693b..e07b2230 100644 --- a/WebUI/src/components/PaintInfo.vue +++ b/WebUI/src/components/PaintInfo.vue @@ -21,7 +21,7 @@ import { useI18N } from '@/assets/js/store/i18n' const props = defineProps<{ - params: KVObject + params: KVObject | undefined }>() const i18n = useI18N().state @@ -46,7 +46,7 @@ function getModeText(key: string, value: number | string) { case 4: return i18n.ENHANCE_OUTPAINT default: - return 'unkonw' + return 'unknown' } } diff --git a/WebUI/src/env.d.ts b/WebUI/src/env.d.ts index d48dea7b..66aad45d 100644 --- a/WebUI/src/env.d.ts +++ b/WebUI/src/env.d.ts @@ -57,7 +57,7 @@ type electronAPI = { getDownloadedGGUFLLMs(): Promise getDownloadedEmbeddingModels(): Promise openImageWithSystem(url: string): void - selecteImage(url: string): void + selectedImage(url: string): void setFullScreen(enable: boolean): void onDebugLog( callback: (data: { diff --git a/WebUI/src/views/Create.vue b/WebUI/src/views/Create.vue index 5a1bd697..15c55f95 100644 --- a/WebUI/src/views/Create.vue +++ b/WebUI/src/views/Create.vue @@ -1,32 +1,28 @@