chrisgoringe / cg-image-picker

199 stars 13 forks source link

Getting "Prompt has no outputs" error when using Preview Chooser in ComfyUI rev. 2066 [f2fe635c] (released on 2024-03-15) #87

Closed bem13 closed 4 months ago

bem13 commented 4 months ago

Hi there. I've updated ComfyUI, including all dependencies and addons yesterday, and ever since then I've been unable to use Preview Chooser. When I try to queue a prompt I get an error message saying "Prompt has no outputs". If I remove Preview Choose and use a Preview Image or Save Image node, there's no error. The error happens regardless of the checkpoint I try to use (in fact, the checkpoint doesn't even get loaded).

Here's a screenshot of the error on the default layout: image

And here's ComfyUI's log, where you can see a rather meaningless error message at the bottom:

** ComfyUI startup time: 2024-03-16 17:07:57.017638
** Platform: Linux
** Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
** Python executable: /home/user/ComfyUI/venv/bin/python
** Log path: /home/user/ComfyUI/comfyui.log

Prestartup times for custom nodes:
   0.0 seconds: /home/user/ComfyUI/custom_nodes/ComfyUI-Manager

Total VRAM 16071 MB, total RAM 31995 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA Graphics Device : cudaMallocAsync
VAE dtype: torch.bfloat16
Using pytorch cross attention
### Loading: ComfyUI-Inspire-Pack (V0.67.1)
### Loading: ComfyUI-Impact-Pack (V4.83.4)
### Loading: ComfyUI-Impact-Pack (Subpack: V0.4)
[Impact Pack] Wildcards loading done.
### Loading: ComfyUI-Manager (V2.10.1)
### ComfyUI Revision: 2066 [f2fe635c] | Released on '2024-03-15'

Import times for custom nodes:
   0.0 seconds: /home/user/ComfyUI/custom_nodes/stability-ComfyUI-nodes
   0.0 seconds: /home/user/ComfyUI/custom_nodes/cg-image-picker
   0.0 seconds: /home/user/ComfyUI/custom_nodes/ComfyUI_Cutoff
   0.0 seconds: /home/user/ComfyUI/custom_nodes/efficiency-nodes-comfyui
   0.0 seconds: /home/user/ComfyUI/custom_nodes/ComfyUI-Manager
   0.0 seconds: /home/user/ComfyUI/custom_nodes/ComfyUI-Inspire-Pack
   0.4 seconds: /home/user/ComfyUI/custom_nodes/ComfyUI-Impact-Pack

Starting server

To see the GUI go to: http://127.0.0.1:8188
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
FETCH DATA from: /home/user/ComfyUI/custom_nodes/ComfyUI-Manager/extension-node-map.json
got prompt
invalid prompt: {'type': 'prompt_no_outputs', 'message': 'Prompt has no outputs', 'details': '', 'extra_info': {}}

Let me know if you need anything else. Thanks in advance!

chrisgoringe commented 4 months ago

TL;DR - You need something downstream of the Chooser. Try adding a Preview Image node to its output.

This is correct behavior. A Comfy workflow requires (at least) one node to be an Output. Save Image and Preview Image nodes are outputs, but Preview Chooser isn't.

That's partly because you are choosing an image to pass on to something else further down the workflow. If you aren't, why would you be using the Preview Chooser instead of a Preview Image node?

But it's also because if a node is an Output, it always runs, which breaks the ComfyUI optimization that avoids recalculating identical parts of the workflow when possible (in the case of Preview Chooser, when the repeat last mode is used it doesn't need to be rerun, and nor does anything downstream of it until something that has been changed).

Until recently Preview Chooser was an Output - but that was incorrect, and prevented the above optimization.