Preview image node

This commit is contained in:
space-nuko
2023-04-07 16:00:06 -05:00
parent 3d8690d6d7
commit d5a85277b7
4 changed files with 14 additions and 4 deletions

View File

@@ -201,6 +201,7 @@ export default class ComfyApp {
private registerNodeTypeOverrides() {
ComfyApp.node_type_overrides["SaveImage"] = nodes.ComfySaveImageNode;
ComfyApp.node_type_overrides["PreviewImage"] = nodes.ComfyPreviewImageNode;
}
private registerWidgetTypeOverrides() {

View File

@@ -26,7 +26,7 @@
}
</script>
<div id="lightboxModal" on:keydown={handleKey}>
<div id="lightboxModal" on:keydown={handleKey} on:click={closeModal}>
<div class="modalControls gradio-container" on:keydown={handleKey}>
<span class="modalZoom cursor" title="Toggle zoomed view" on:click={toggleZoom} on:keydown={handleKey}>&#10529;</span>
<span class="modalTileImage cursor" title="Preview tiling" on:click={previewTiling} on:keydown={handleKey}>&#8862;</span>

View File

@@ -10,13 +10,16 @@ export type ComfyImageExecOutput = {
images: ComfyImageResult[]
}
export default class ComfySaveImageNode extends ComfyGraphNode {
/*
* Node with a single extra image output widget
*/
class ComfyImageNode extends ComfyGraphNode {
private _imageResults: Array<ComfyImageResult> = [];
private _galleryWidget: ComfyGalleryWidget;
constructor(title?: any) {
super(title)
this._galleryWidget = new ComfyGalleryWidget("Images", this._imageResults, this);
this._galleryWidget = new ComfyGalleryWidget("Images", [], this);
this.virtualWidgets.push(this._galleryWidget)
}
@@ -32,3 +35,9 @@ export default class ComfySaveImageNode extends ComfyGraphNode {
this._galleryWidget.setValue(galleryItems)
}
}
export class ComfySaveImageNode extends ComfyImageNode {
}
export class ComfyPreviewImageNode extends ComfyImageNode {
}

View File

@@ -1,2 +1,2 @@
export { default as ComfyReroute } from "./ComfyReroute"
export { default as ComfySaveImageNode } from "./ComfySaveImageNode"
export { ComfySaveImageNode, ComfyPreviewImageNode } from "./ComfyImageNodes"