Commit Graph

66 Commits

Author SHA1 Message Date
Arjan Singh
44e470488d [feat] carve out path to call asset browser in combo widget (#5464)
* [ci] ignore local browser tests files

this is where i have claude put its one off playwright scripts

* [feat] carve out path to call asset browser in combo widget

* [feat] use buttons on Model Loaders when Asset API setting is on
2025-09-10 22:26:07 -07:00
AustinMroz
fc8d5621ac Implement subgraph publishing (#5139)
* Implement subgraph publishing

* Add missing null check

* Fix subgraph blueprint display in workflows tab

* Fix demotion of subgraph blueprints on reload

* Update locales [skip ci]

* Update blueprint def on save, cleanup

* Fix skipped tracking on subgraph publish

When a subgraph is first published, it previously was not added to the
subgraphCache. This would cause deletion to fail until a reload occurred.

* Fix failing vite tests

A couple of tests that were mocking classes broke SubgraphBlueprint
inheritance. Since they aren't testing anythign related to subgraph
blueprints, the subgraph store is mocked as well.

* Make blueprint breadcrumb badge clickable

* Add confirmation for overwrite on publish

* Simplify blueprint badge naming

* Swap to promise.allSettled when fetching subgraphs

* Navigate into subgraph on blueprint edit

* Revert mission of value in blueprint breadcrumb

This was causing the blueprint badge to always display

* Misc code quality fixes

* Set subgraphNode title on blueprint add.

When a subgraph blueprint is added to the graph, the title of the
subgraphNode is now set to be the title of the blueprint.

NOTE: The name of the subgraph node when a blueprint is edited is left
unchanged. This may cause minor user confusion.

* Add "Delete Blueprint" option to breadcrumb

When editing a blueprint, the options provided for the root graph of the
breadcrumb included a Delete Workflow option. This still functioned for
deleting the current blueprint when selected, but didn't make sense. It
has been updated to instead describe that it deletes the current
blueprint

* Extract subgraph load code as function

* Fix subgraphs appearing in library after refresh

Subgraph nodes were hidden from the node library and context menu by
setting skip_list to true. Unfortunately, this causes them to be
mistakenly be caught and registered as vue nodes when a refresh is
performed. This is fixed by adding a check for skip_list.

* Add delete button and confirmation for deletion

* Use more specific warning for blueprint deletion

* At success toast on subgraph publish

Will return later to potentially add a node library link to the toast

* Don't apply subgraph context menu to normal nodes

Subgraph blueprints have a right click -> delete option in the node
library.  This was incorrectly being dislplayed on non blueprint nodes.

* Remove hardcoded subgraphs path

Rather happy with this change. Rather than trying to introduce a
recursive import to pass a magic string, this solution is both
sufficient AND allows potential future extensions with less breakage.

* Fix nodeDef update on save

Wait to update the node def cache until after a blueprint has been
saved. Before, changes to links weren't actually being made visisble.

* Fix SaveAs with subgraph blueprints

* Remove ugly serialize/deserialize

Thought I had already tested this, and found that the mere existence of
proxies was causing issues, but simply adding a correct annotation is
sufficient now.

* Improve error specificity

* Framework for user defined blueprint descriptions

BlueprintDescription can be added to a workflows extra field to provide
more useful information about a blueprint's purpose

Actually hooking this up in a way that is user accessible is out of
scope for right now, but this will simplify future implementation.

* Cleanup breadcrumb dropdown options

Removes Dupliate for blueprints, adds a publish subgraph option.

The publish subgraph button currently routes through the save as logic.
Unforunately, this results in the prompt for name referencing workflows.
The cleanest way to resolve this is still being considered

* Move blueprint renaming into blueprint load

Blueprints should automatically set the name of the added node to the
filename when added. This mostly worked, but created uglier edgecases:
The subgraph itself wasn't renamed, and it would need to be
reimplemented to apply when editing a blueprint.

Instead, this is now applied when a subgraphBlueprint is first loaded.
This keeps all the logic routed through a single point

* Move saveAs prompt into workflow class

Ensures that the correct publish text is displayed when editing
blueprints without making an awful mess of imports

* Fix tests by making subgraphBlueprint internal

This has the added benefit of forcing better organization.

Reverts the useWorkflowThumbnail patch as it is no longer required.

* Add tests for subgraph blueprints

* Rewrite confirmation dialog

* Fix overwrite on publish new subgraph

1 is used as a placeholder size as -1 indicates the baking userFile is
temporary, not persisted, and therefore, not able to overwrite when
saved.

* When editing blueprint, tint background blue

* Fix blueprint tint at low LOD

* Set node source for blueprints to Blueprint

* Fix publish test

Making subgraph blueprints non temporary on publish made it so the
following load actually occurs. A mock has been added for this load.

* Fix multiple nits

* Further cleanup: error handling, and comments

* Fixing failing test cases

This also moves the bg tinting to a property of the workflow,
which makes things more extensible in the future.

* Fix temporary marking on publish.

The prior fix to allow overwrite of an existing blueprint on publish was
misguided. By marking a not-yet-loaded file as non-temporary, the load
performed prior to saving was actually fetching the file off disk and
discarding the existing changes. This additionally entirely prevented
publishing when a blueprint did not already exist with the current name.

To fix this, the blueprint is not marked as non-temporary until after
the load occurs. Note that this load is still required as it initializes
the change tracker state required for saving.

* Block unloading subgraph blueprints

Will need to be revisited if lazy loading is implemented, but this
requires solving some ugly sync/async issues.

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-09-06 21:27:04 -07:00
Simula_r
1e9d4c7c37 Fix/widget ordering consistency (#5106)
* feat: input ordered nodes

* fix: ensure node input order upon creation using input_order

* refactor: back to the original state of migrations.ts

* refactor: remove console.logs

* test: fix widget ordering tests

* fix: any types
2025-08-20 11:07:40 -07:00
AustinMroz
9dbdc6a72b Fix inconsistency on bypass from context menu (#4988)
When a node is bypassed from the selection toolbox or by pressing a
keybind for bypass, it will also recursively bypass the contents of a
subgraph. This effect was not applied when clicking the bypass button
from the context menu. The context menu option has been updated to
perform the same action as the others so that behaviour is consistent.
2025-08-14 22:34:20 -07:00
AustinMroz
db71365768 Implement subgraph unpacking (#4840) 2025-08-12 13:45:29 -07:00
Christian Byrne
c42c9315f4 [refactor] Replace lodash with es-toolkit (#4935) 2025-08-12 12:22:09 -07:00
AustinMroz
1fc4fd2ca8 Remove subgraphs from add node context menu (#4820) 2025-08-07 14:54:14 -07:00
Benjamin Lu
fad8dae796 Merge branch 'main' into bl-merge-lg-fe 2025-08-05 18:24:29 -04:00
Christian Byrne
681d4c6758 [Bug] SaveAnimatedPNG node does not display generated APNG (#4197)
Co-authored-by: github-actions <github-actions@github.com>
2025-08-04 14:57:54 -07:00
Benjamin Lu
fef02e5f56 [refactor] Migrate litegraph imports from npm package to local subtree
- Updated all imports from '@comfyorg/litegraph' to '@/lib/litegraph/src/'
- Replaced deep dist imports with direct source paths
- Updated CSS import in main.ts
- All imports now use the @ alias consistently
2025-08-03 22:06:29 -04:00
Christian Byrne
f987cf9dbd [feat] Improve SubgraphNode badge with sitemap icon and primary color (#4596) 2025-07-30 02:48:02 -07:00
brucew4yn3rp
83aa887456 [Feature] Enhanced MaskEditor to an Image Canvas (#4361)
Co-authored-by: duckcomfy <a@a.a>
2025-07-24 16:23:50 +10:00
guill
7eb3eb2473 Update the frontend to support async nodes. (#4382)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Christian Byrne <cbyrne@comfy.org>
2025-07-23 13:46:00 +10:00
Christian Byrne
1cd6a7f667 [chore] Update litegraph to 0.16.14 (#4494) 2025-07-21 17:48:32 -07:00
Christian Byrne
a39f6e6763 [feat] DOM widget promotion for subgraph inputs (#4491) 2025-07-21 11:52:54 -07:00
filtered
a7fb685290 Add Subgraphs (#3905)
Co-authored-by: github-actions <github-actions@github.com>
2025-06-28 15:37:23 -07: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
6b8bf989f1 [API Nodes] Apply yellow color to api nodes by default (#3766) 2025-05-05 13:56:11 -04:00
filtered
8713cd6e25 [TS] Require override keyword (#3746) 2025-05-03 19:54:45 -04:00
filtered
a944372f39 Improve default node sizes (#3596)
Co-authored-by: github-actions <github-actions@github.com>
2025-04-24 12:42:16 -04:00
AustinMroz
3819db5ec4 Introduce widgetType option to inputSpec (#3550) 2025-04-23 20:36:01 -04:00
filtered
6e5930c355 [API] Add sockets to custom widgets by default (#3548) 2025-04-21 15:24:48 -04:00
filtered
53ee5904e8 [TS] Fix serialisation type (#3541) 2025-04-21 21:13:42 +10:00
Chenlei Hu
dc5d7ea1be [lint] Enforce @typescript-eslint/no-floating-promises (#3402) 2025-04-11 12:19:22 -04:00
Chenlei Hu
609496957b [Cleanup] Remove WidgetOptions.forceInput (#3362) 2025-04-09 11:36:35 -04:00
Chenlei Hu
a879f413bb [Cleanup] Remove WidgetOptions.inputIsOptional (#3361) 2025-04-09 10:45:51 -04:00
Chenlei Hu
2c02d4ebb3 Migrate forceInput widgets_values (#3337)
Co-authored-by: github-actions <github-actions@github.com>
2025-04-06 21:27:42 -04:00
Chenlei Hu
ac53296b2e Support associated socket for widgets (#3326)
Co-authored-by: github-actions <github-actions@github.com>
2025-04-06 11:50:21 -04:00
Chenlei Hu
733d71aaac [Refactor] Split node constructor logic (#3307) 2025-04-01 20:48:32 -04:00
Chenlei Hu
8c789bd05d [Refactor] Use litegraph LGraphNode.strokeStyles API (#3278) 2025-03-30 12:05:45 -04:00
Chenlei Hu
28def833f9 [TS] Fix node constructor signature (#3276) 2025-03-29 20:55:11 -04:00
Chenlei Hu
24dcaa7f72 [i18n] Translate toast messages (#3228)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-24 22:22:17 -04:00
Chenlei Hu
a049e9ae2d [TS] Enable strict mode (#3136) 2025-03-18 22:57:17 -04:00
Chenlei Hu
7af003fcab [TS] Enable noUnusedParameters (#3110) 2025-03-17 16:47:45 -04:00
Christian Byrne
3956e31810 Fix LoadAudio node (#3065)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-14 21:44:39 -07:00
Chenlei Hu
ec013cc511 Draw canvas image preview in a widget (#2952) 2025-03-09 21:56:50 -04:00
Chenlei Hu
1558a5bb19 [Refactor] Add useNodeAnimatedImage composable (#2950) 2025-03-09 18:08:03 -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
f7be9157e0 Dom widget store (#2899) 2025-03-06 13:23:58 -05:00
Christian Byrne
caaf050728 Fix animated webp output preview (#2897) 2025-03-06 11:19:48 -05:00
Chenlei Hu
15e396b4cc [Refactor] Remove app.getWidgetType (#2880) 2025-03-05 14:02:13 -05:00
Chenlei Hu
1882a9af6f Fix node min size specified by widget constructor (#2876) 2025-03-05 12:09:29 -05:00
Chenlei Hu
621568f99e Fix extension node def manipulation (#2873) 2025-03-05 11:18:58 -05:00
Chenlei Hu
d0ce2d2597 [Cleanup] Refactor widget construction (#2861) 2025-03-04 17:40:13 -05:00
Chenlei Hu
2d179ad632 [Refactor] Use node def v2 in registerNodeDef (#2856) 2025-03-04 12:07:13 -05:00
Chenlei Hu
51aafaec08 [TS] Fix InputSpec type in node constructor (#2846) 2025-03-03 21:26:21 -05:00
Chenlei Hu
09ab14ac81 [Type] Disallow type upcasting for node input spec (#2790) 2025-03-01 16:58:45 -05:00
Chenlei Hu
1d95d639e9 [Refactor] Extract nodeDefSchema from apiSchema (#2756) 2025-02-27 13:39:23 -05:00
Chenlei Hu
cdf42d5ad7 [Refactor] Move zod schemas to schemas/ folder (#2753) 2025-02-27 13:05:01 -05:00
Chenlei Hu
d3dda14267 Update litegraph 0.8.95 (#2718) 2025-02-24 19:48:44 -05:00