Comfy-Org / Comfy-Org/ComfyUI_frontend
Mixed text+image jobs are omitted from Jobs / Media Assets when /api/jobs selects a text preview_output
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
### Prerequisites
- [x] I am running the latest version of ComfyUI
- [x] I have custom nodes enabled
### What happened?
On the latest ComfyUI release, a workflow that produces both:
- a text preview via core Preview as Text
- an image preview via core Preview Image
can complete successfully, but the completed job is missing from:
- the Jobs panel
- the Media Assets (Generated) / assets panel
Other jobs remain visible. The workflow itself succeeds. The issue seems to happen when the job returned by /api/jobs uses a text-shaped preview_output even though the same job also has a valid image preview in outputs. This happens only when text output is evaluated before all other outputs in the graph (proof: adding a "heavy" node as an upstream node before a text output fixes the issue, as the text is no longer the first to be evaluated).
From the web browser Network tab, the affected job looks like this:
`{
"id": "…",
"status": "completed",
"outputs_count": 3,
"preview_output": {
"content": "1048576",
"nodeId": "6",
"mediaType": "text"
},
"outputs": {
"6": {
"text": ["1048576"]
},
"7": {
"images": [
{
"filename": "ComfyUI_temp_....png",
"subfolder": "",
"type": "temp"
}
]
}
}
}`
The important part is that the job contains a valid image preview in outputs, but preview_output is still text-shaped.
When preview_output is file/media-shaped instead, the job appears normally. Example of a working job payload:
`{
"preview_output": {
"filename": "ComfyUI_temp_....png",
"subfolder": "",
"type": "temp",
"nodeId": "7",
"mediaType": "images"
}
}`
Expected behavior:
- if a job has any valid image/video/audio/3d/file preview, that preview should be used for the job thumbnail
- the job should still appear in Jobs and Media Assets (Generated)
Actual behavior:
- If preview_output is text-shaped, the job is silently omitted from the Assets Panel, and appears with no thumbnail in the Jobs panel, even though the run completed and the job has a valid image preview in outputs
This no longer hard-crashes the whole panel (as happened in previous version of ComfyUI, which caused Zod errors), but the affected job still disappears from the UI.
This appears related to how /api/jobs selects preview_output from mixed-output jobs. From code inspection, the current backend logic in comfy_execution/jobs.py still allows text previews to become preview_output depending on output insertion/order, even when an image preview also exists.
### Steps to Reproduce
1. Start the latest ComfyUI release.
2. Create a workflow that produces both:
- an image preview using core Preview Image
- text preview using core Preview as Text
3. The easiest repro is:
- load an image
- send the image to Upscale Image By node and then to a Preview Image
- also send the original image to Get Image Size node and connect a core Preview as Text node to one of it's outputs.
4. Run the workflow successfully.
5. Open the Jobs panel and Media Assets (Generated) panel.
6. Observe that the completed job may be missing from the Assets panel, and shows with no image thumbnail in the Jobs panel.
7. Open DevTools -> Network and inspect:
- GET /api/jobs?status=completed,failed,cancelled...
8. Find the missing job in the response and compare:
- broken case: preview_output is text-shaped, e.g. { "content": "...", "nodeId": "...", "mediaType": "text" }
- working case: preview_output is media/file-shaped, e.g. { "filename": "...png", "subfolder": "", "type": "temp", "nodeId": "...", "mediaType": "images" }
9. Confirm that the broken job still contains a valid image preview under outputs, but the UI does not show the job.
### How is this affecting you?
Visual/UI issue only
### ComfyUI Frontend Version
1.42.11
### Browser
Chrome/Chromium
### Console Errors
```javascript
```
### Logs
```shell
```
### Additional Context
_No response_
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11262-Mixed-text-image-jobs-are-omitted-from-Jobs-Media-Assets-when-api-jobs-selects-a-t-3436d73d3650817c8621fe85928fdaff) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.