Commit Graph

79 Commits

Author SHA1 Message Date
Christian Byrne
1d014c0dbe feat: when restored position has no nodes in viewport, automatically fit to view (#7435)
## Summary

Sometimes the saved position is super far away from any of the nodes,
which causes general confusion. This PR changes the `loadGraphData`
logic to fit-to-view in those scenarios.

Fixes https://github.com/Comfy-Org/ComfyUI_frontend/issues/7425

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7435-feat-when-restored-position-has-no-nodes-in-viewport-automatically-fit-to-view-2c86d73d36508119bf2ed9d361ec868f)
by [Unito](https://www.unito.io)

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-12-17 15:38:05 -08:00
Christian Byrne
585d46d4fb fix: inner groups being moved double when moving outer group (in vue mode) (#7447)
## Summary

Fixes issue when dragging a group that had inner groups when in vue
mode.

When dragging the outer group in Vue mode:

1. getAllNestedItems(selected) returns ALL items: outer group + inner
groups + nodes
2. moveChildNodesInGroupVueMode loops through all items
3. For outer group G1: calls G1.move(delta, true) then
moveGroupChildren(G1, ...)
4. moveGroupChildren calls G2.move(delta) (no skipChildren) - this moves
G2 AND G2's children!
5. Then the loop reaches G2: calls G2.move(delta, true) - moves G2 again
6. Plus moveGroupChildren(G2, ...) processes G2's children again

This PR fixes it by adding `skipChildren=true` to the `move` call.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7447-fix-inner-groups-being-moved-double-when-moving-outer-group-in-vue-mode-2c86d73d365081ce97abec682f2a8518)
by [Unito](https://www.unito.io)
2025-12-14 18:37:29 -08:00
Christian Byrne
d21ea0f65b fix: loading api-format workflow that contains "parameters" string (#7411)
## Summary

This change extends
https://github.com/Comfy-Org/ComfyUI_frontend/pull/7154 by making sure
the `prompt` metadata tag is parsed before the legacy A1111 fallback
when files are dropped onto the canvas.

ComfyUI embeds two structured payloads into every first-class export
format we support (PNG, WEBP, WEBM, MP4/MOV/M4V, GLB, SVG, MP3,
OGG/FLAC, etc.): `workflow`, which is the full editor JSON with layout
state, and `prompt`, which is the API graph sent to `/prompt`.

During import we try format-specific decoders first and only as a last
resort look for an A1111 file by scanning text chunks for a `parameters`
entry. That compatibility path was always meant to be a best-effort
option, but when we refactored the loader it accidentally enforced the
order `workflow → parameters → prompt`. As soon as a dropped asset
contained a `parameters` chunk—something Image Saver’s “A1111
compatibility” mode always adds—the A1111 converter activated and
blocked the subsequent `prompt` loading logic.

PR #7154 already lifted `workflow` ahead of the fallback, yet any file
lacking the `workflow` chunk but holding both `prompt` and `parameters`
still regressed. Reordering to `workflow → prompt → parameters`
preserves the compatibility shim for genuine A1111 exports while
guaranteeing native Comfy metadata always wins, eliminating the entire
class of failures triggered merely by the presence of the word
`parameters` in an unrelated metadata chunk.

Fixes https://github.com/Comfy-Org/ComfyUI_frontend/issues/7096, fixes
https://github.com/Comfy-Org/ComfyUI_frontend/issues/6988

## Related 

(fixed by https://github.com/Comfy-Org/ComfyUI_frontend/pull/7154)

- https://github.com/Comfy-Org/ComfyUI_frontend/issues/6633
- https://github.com/Comfy-Org/ComfyUI_frontend/issues/6561

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-12-12 21:39:30 -07:00
AustinMroz
3c8b7b015c Fix subgraphNode widget cloning with compressed target_slot (#7388)
## Cause
When graphs are actually exported, several layers of cleanup are
applied. Among these is link compression. Any widgets with inputs that
aren't used do not have inputs stored in the workflow. This was
implemented for backwards compatibility with the old "convert to input"
system for widgets. As part of this process, the target_slots on links
are rewritten such that they point to the index of the widget as if
unconnected widgets did not exist.

This "incorrect" state for links is only corrected AFTER a workflow has
loaded because the 'fix' method needs nodes to be initialized in order
to calculate the correct target_slot

This becomes a problem when subgraphs are introduced. SubgraphInputs
need to resolve a link to its target slot in order to construct a clone
of the linked widget DURING the loading process. Since this target slot
is not accurate, this can result in the cloned widget having the wrong
type.

For a minimal reproduction:
- Create a subgraph with an Empty Latent Image with batch_size linked to
the Subgraph Input
- Export the workflow
- On load, the batch_size has step and min attributes which incorrectly
correspond to width

## Fix
There's multiple possible ways to address this and input on direction is
appreciated
- Fix links before loading graph
  - Likely to break with any dynamic state
- Fix links, then load graph again
- Ugly, bad performance, dynamic state may require multiple passes to
correctly ripple
- In the Subgraph code, ignore target_slot and instead `.find()` input
with matching linkId (proposed)
- Promising, but means accepting that state is just wrong sometimes.
Another forever footgun.
- Entirely remove the input compression
- Some people may complain, and old workflows still need to be supported
- Only remove target_slot redirection inside subgraphs
- Creates ugly logical difference between what happens inside and
outside subgraphs.
  - Still leaves old workflows broken

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7388-Remove-target_slot-compression-from-subgraph-exports-2c66d73d3650815d8c96c5047958ab67)
by [Unito](https://www.unito.io)
2025-12-11 12:32:35 -08:00
Christian Byrne
06b0eecfe4 fix Vue node widgets should be in disabled state if their slots are connected with a link (#5834)
## Summary

Fixes https://github.com/Comfy-Org/ComfyUI_frontend/issues/5692 by
making widget link connection status trigger on change so Vue widgets
with connected links could properly switch to the `disabled` state when
they are implicitly converted to inputs.

## Changes

- **What**: Added `node:slot-links:changed` event tracking and reactive
slot data synchronization for Vue widgets

```mermaid
graph TD
    A[Widget Link Change] --> B[NodeInputSlot.link setter]
    B --> C{Is Widget Input?}
    C -->|Yes| D[Trigger slot-links:changed]
    C -->|No| E[End]
    D --> F[Graph Event Handler]
    F --> G[syncNodeSlotData]
    G --> H[Update Vue Reactive Data]
    H --> I[Widget Re-render]
    
    style A fill:#f9f9f9,stroke:#333,color:#000
    style I fill:#f9f9f9,stroke:#333,color:#000
```

## Review Focus

Widget reactivity performance with frequent link changes and event
handler memory management in graph operations.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5834-fix-Vue-node-widgets-should-be-in-disabled-state-if-their-slots-are-connected-with-a-link-27c6d73d365081f6a6c3c1ddc3905c5e)
by [Unito](https://www.unito.io)
2025-10-09 10:30:12 -07:00
Christian Byrne
e0b1a6d212 [test] fix flaky Vue upload widget browser tests using randomize url param (#5845)
## Summary

Fix browser tests that use filenames in loader nodes. When the files
don't exist, the fallback/error component shows the request URL which
contains random cache-busting param which makes tests fail due to
non-deterministic nature.


[Context](https://github.com/Comfy-Org/ComfyUI_frontend/pull/5831#discussion_r2386582256)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5845-test-fix-flaky-Vue-upload-widget-browser-tests-using-randomize-url-param-27d6d73d36508107a0d0d52d2764a028)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions <github-actions@github.com>
2025-09-28 23:28:52 -07:00
Christian Byrne
bbd8d67f5f designate canvasOnly on runtime-generated virtual widgets so they are hidden in Vue renderer (#5831)
## Summary

Added `canvasOnly` flag to runtime-generated widgets to prevent Vue
renderer from displaying them while keeping canvas functionality intact.

## Changes

- **What**: Added `canvasOnly` widget option to hide upload, webcam, and
refresh widgets from Vue renderer

In the Canvas (LiteGraph) system, there was a small set of widgets with
strictly defined components. There, if we wanted some unique or
relatively complex behavior (like an upload butotn), we needed to create
a separate widget that would be coupled to the original widget at
runtime (and would not be serialized).

In the Vue renderer system, we can simply add flags to the inputSpec or
widget options and conditionally render complex UI additions -- i.e.,
there is no need for the hard-to-maintain runtime widget associations.
Expressing such things entirely in the view layer simplifies business
logic related to graph state, as we no longer need to account for
preserving the connections between runtime widgets and their special
siblings -- we also do not need to worry about the implications for
state serialization.

## Related

- https://github.com/Comfy-Org/ComfyUI_frontend/pull/5798

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5831-designate-canvasOnly-on-runtime-generated-virtual-widgets-so-they-are-hidden-in-Vue-ren-27c6d73d365081fb8641feec010190df)
by [Unito](https://www.unito.io)

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-09-28 18:48:29 -07:00
Benjamin Lu
893409dfc8 Add playwright tests for links and slots in vue nodes mode (#5668)
Tests added
- Should show a link dragging out from a slot when dragging on a slot
- Should create a link when dropping on a compatible slot
- Should not create a link when dropping on an incompatible slot(s)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5668-Add-playwright-tests-for-links-and-slots-in-vue-nodes-mode-2736d73d36508188a47dceee5d1a11e5)
by [Unito](https://www.unito.io)

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-09-19 13:51:47 -07:00
Alexander Brown
85017dbba0 Upgrade: Tailwind v4 (#5246)
* temp: move tailwind calls out of the layer

* temp: ts tailwind config

* upgrade: Tailwind v4
This got a little out of hand.
Had to add a relative reference to the stylesheet in any component that uses @apply instead of the utility classes directly.

* upgrade: bg-opacity is now a modifier

* fix: Classic menu buttons assume a border

* Update test expectations [skip ci]

* fix: New preflight removal pattern

* fix: Skeletons don't have skin

* Update test expectations [skip ci]

* fix: Missing @reference

* [auto-fix] Apply ESLint and Prettier fixes

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: GitHub Action <action@github.com>
2025-09-03 12:37:43 -07:00
Christian Byrne
efd9b04a6e [refactor] Organize all browser test assets into logical folders (#5058)
* move subgraph test assets into subfolder

* [refactor] Organize browser test assets into logical folders

Reorganized test assets for better maintainability:
- groupnodes/: GroupNode feature tests
- groups/: Visual grouping tests
- missing/: Missing nodes/models tests
- links/: Link-related tests
- inputs/: Input widget tests
- widgets/: Widget-specific tests
- nodes/: Node-related tests
- workflowInMedia/: Workflow media files

Updated all loadWorkflow references to use new folder structure.
Fixed programmatic filename references to prevent test failures.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* [fix] Update mobile test to use new asset path

* [fix] Update remaining loadWorkflow calls to use new folder structure

* [fix] Fix remaining programmatic filename references

* [fix] Run prettier formatting

* [fix] Fix setupWorkflowsDirectory references to use correct folder paths

* [refactor] Rename subgraph folder to subgraphs for consistency

* [fix] Fix breadcrumb name in subgraph DOM widget test

* Update test expectations [skip ci]

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions <github-actions@github.com>
2025-08-18 10:39:53 -07:00
Christian Byrne
7972550f6b [fix] Fix link deletion from middle button when connected to reroute nodes deletes wrong link (#4928)
Co-authored-by: github-actions <github-actions@github.com>
2025-08-11 19:26:37 -07:00
Jin Yi
4c6e7f106b [fix] Detect missing nodes in subgraphs (#4639)
Co-authored-by: bymyself <cbyrne@comfy.org>
2025-08-02 19:45:05 -07:00
Ferrah Aiko
37bfc53616 Add the ability to parse workflows from AVIF images (#4420) 2025-07-23 23:20:39 -07:00
Christian Byrne
7b32a2fb6e [tests] Add browser tests for subgraph functionalities (#4495) 2025-07-22 10:35:49 -07:00
Christian Byrne
a70d69cbd2 [fix] Sync subgraph node title changes with breadcrumb navigation (#4394) 2025-07-13 07:37:48 +10:00
Christian Byrne
b81c2f7cd2 [bugfix] Filter model metadata by current widget selection (#4021)
Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com>
2025-06-01 12:43:00 +10:00
Christian Byrne
4cc6a15fde Fix refresh combos command fails on nodes using V2 spec (#3848) 2025-05-10 16:06:25 -04:00
Chenlei Hu
2a297e512d Fit view on workflow load without extra.ds (#3822)
Co-authored-by: github-actions <github-actions@github.com>
2025-05-08 17:39:44 -04:00
Chenlei Hu
2019c1d877 Align reset_view param on json file load (#3823) 2025-05-08 16:00:13 -04:00
Chenlei Hu
2425e32d51 Partial execute to selected output nodes (#3818)
Co-authored-by: github-actions <github-actions@github.com>
2025-05-08 11:44:26 -04:00
thot experiment
878aedb4f7 add svg metadata loading (#3719)
Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com>
2025-05-02 09:26:24 +10:00
Christian Byrne
99cc587abf Load workflows from mp4/mov files (#3543)
Co-authored-by: github-actions <github-actions@github.com>
2025-04-26 12:31:29 -07:00
Christian Byrne
87bf2310b6 Support previewing animated image uploads (#3479)
Co-authored-by: github-actions <github-actions@github.com>
2025-04-17 10:20:09 -04:00
Chenlei Hu
a500a96c4a [TS] Fix widget GET_CONFIG on loading primitive nodes (#3374) 2025-04-09 17:48:28 -04:00
Chenlei Hu
05023b7889 Migrate defaultInput widget option (#3364)
Co-authored-by: github-actions <github-actions@github.com>
2025-04-09 13:51:34 -04:00
Chenlei Hu
a489c19b07 Upstream rgthree's link fixer (#3350) 2025-04-08 18:32:43 -04:00
Chenlei Hu
3a1c95fb10 [Bug] Fix input link slots (#3349)
Co-authored-by: github-actions <github-actions@github.com>
2025-04-08 11:08:42 -04:00
Chenlei Hu
ac3bd7a848 [Test] Add test on dynamically added inputs (#3344)
Co-authored-by: github-actions <github-actions@github.com>
2025-04-07 22:22:32 -04:00
Chenlei Hu
854501ef27 Show object widget values as string on missing nodes (#3294)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-31 20:55:50 -04:00
Chenlei Hu
00d281c7fa [Test] Add playwright tests (#3245)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-26 16:32:42 -04:00
Christian Byrne
4dad89369a Load workflows from GLTF files (#3169)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-20 20:55:51 -04:00
AustinMroz
f583015a14 Fix regression when configuring graph with missing converted input (#3066) 2025-03-16 11:36:42 -04:00
Chenlei Hu
20d2eca51e [Test] Add playwright test on litegraph native reroute (#3033)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-13 21:06:07 -04:00
Chenlei Hu
6e378c68f9 [Bug] Fix load audio node (#2927)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-08 20:17:19 -05:00
Chenlei Hu
91388e8b16 [Test] Add playwright test on connect to dom widget (#2912)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-07 14:24:55 -05:00
Chenlei Hu
c3a984a293 [Test] Add test on load image widget (#2875)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-05 12:09:14 -05:00
Chenlei Hu
eceea51800 [Test] Add playwright test on Note and MarkdownNote (#2853)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-04 10:04:03 -05:00
bymyself
792c5f2246 Load workflows from webm files (#2772)
Co-authored-by: github-actions <github-actions@github.com>
2025-02-28 16:00:02 -05:00
bymyself
e380d792c7 Support models metadata in node properties (#2754) 2025-02-27 13:25:16 -05:00
bymyself
74e8852958 Fix combo values from optional inputs not changed when refreshing (#2733) 2025-02-26 10:35:22 -05:00
Chenlei Hu
cbf5dff633 Update litegraph 0.8.87 (#2625)
Co-authored-by: github-actions <github-actions@github.com>
2025-02-18 20:25:17 -05:00
bymyself
108884a304 Replace "clip" with "text_encoders" in template workflows (#2572) 2025-02-16 09:39:10 -05:00
Chenlei Hu
d7a0ee8703 Update litegraph 0.8.76 (#2496)
Co-authored-by: github-actions <github-actions@github.com>
2025-02-10 15:30:46 -05:00
bymyself
a914456827 Add support for new COMBO input spec and lazy/remote COMBO widgets (#2422) 2025-02-07 15:35:42 -05:00
bymyself
117c8be3a0 Use fp16 safetensors model in default/fallback workflow (#2433)
Co-authored-by: github-actions <github-actions@github.com>
2025-02-06 19:47:14 -05:00
Chenlei Hu
5f850ddaa4 [BrowserTest] Add test on boolean widget (#2421)
Co-authored-by: github-actions <github-actions@github.com>
2025-02-04 17:28:32 -05:00
bymyself
77be5ac514 [BrowserTest] Add test on groupnode with duplicate hidden inputs (#2403) 2025-02-02 21:03:08 -05:00
bymyself
842a9f74fc [BrowserTest] Fix flaky gallery test (#2150) 2025-01-17 17:11:49 -05:00
filtered
79fee6ac72 Fix collapsed node textarea causes UI inconsistency (#2267) 2025-01-16 11:50:53 -05:00
bymyself
74b02237db Add virtual scroll to Queue Tab for improved performance (#2108) 2024-12-31 12:35:29 -05:00