Reuse sent gallery image width/height

This commit is contained in:
space-nuko
2023-05-26 19:50:19 -05:00
parent 51e02f8179
commit 1da8dc35ec

View File

@@ -99,6 +99,12 @@ export default class ComfyGalleryNode extends ComfyWidgetNode<ComfyBoxImageMetad
if (newIndex != null) { if (newIndex != null) {
this.selectedImage.set(newIndex) this.selectedImage.set(newIndex)
this.forceSelectImage.set(true) this.forceSelectImage.set(true)
const image = this.getValue()[newIndex]
if (image) {
this.imageWidth.set(image.width || 0)
this.imageHeight.set(image.height || 0)
}
} }
} }