Fix editor and consolidate file upload widget

This commit is contained in:
space-nuko
2023-05-13 23:05:54 -05:00
parent 152a1c6097
commit 28c9e6ba57
6 changed files with 341 additions and 36 deletions

View File

@@ -33,6 +33,7 @@
uploaded: ComfyImageLocation[];
upload_error: any;
clear: undefined;
image_clicked: undefined;
}>();
if (value) {
@@ -58,6 +59,10 @@
dispatch("clear")
}
function onImgClicked() {
dispatch("image_clicked")
}
interface GradioUploadResponse {
error?: string;
files?: Array<ComfyImageLocation>;
@@ -205,6 +210,7 @@
<ModifyUpload on:clear={handle_clear} absolute />
<img src={convertComfyOutputToComfyURL(firstImage)}
alt={firstImage.filename}
on:click={onImgClicked}
bind:this={imgElem}
bind:naturalWidth={imgWidth}
bind:naturalHeight={imgHeight}