4 Commits
Author SHA1 Message Date
Will Miao 1f58e78717 fix(loaders): migrate backslash values on subgraph boundary widgets (#1149)
Promoted combo widgets on a subgraph boundary hold their own store-backed
copy of the interior widget's value, seeded from the workflow's serialized
widgets_values, so migrating the interior loader widget never reached them:
the boundary combo kept the old backslash spelling, the frontend flagged it
as a missing model on load, and the error entry (keyed to the host node)
survived the interior node's onWidgetChanged.

- migrateWidgetValue generalizes the separator migration to any widget.
- applyToAllNodes now also migrates the projected boundary widgets of every
  subgraph node; their value setter writes through to the frontend's widget
  store, and firing the host node's onWidgetChanged clears the host-keyed
  error entries. Fixing the values before the post-load missing-model scan
  means the flags are never raised at all.
- The per-node onConfigure hook schedules a boundary sweep via
  queueMicrotask so pasted subgraph nodes (which bypass the graph-level
  configure hook) get covered once the paste settles.
2026-10-23 08:46:12 +08:00
Will Miao 1276673e0e fix(loaders): migrate backslash values in subgraphs and clear the error flag (#1149)
The follow-up report found three gaps in the value migration:

* applyToAllNodes only walked the root graph, so loader nodes inside
  subgraphs kept their backslash values. It now recurses through
  node.subgraph (Subgraph extends LGraph, so .nodes works at every level).
  Promoted combo widgets share the interior widget's store-backed value,
  so migrating the interior widget fixes the subgraph boundary too.
* Pasted nodes never hit the graph-level configure hook. A per-node
  onConfigure wrapper now runs the same sanitize + migrate pass after
  widget values restore.
* The corrected value kept its stale "value not in list" flag. The
  migration now fires the node's onWidgetChanged hook, which the
  frontend's error-clearing chain uses to drop value_not_in_list errors.
2026-10-17 17:12:41 +08:00
Will Miao be0133a699 fix(loaders): accept backslash-spelled model names from old workflows (#1149)
The forward-slash paths fix changed the checkpoint/unet combo lists on
Windows from "dir\model.safetensors" to "dir/model.safetensors", so
workflows saved before it loaded with a value no option matches: the
front-end extension reset the widget to the first model, or ComfyUI
flagged it "value not in list" when the widget was wired.

Two layers:

* random_loader_control.js migrates the widget value to its
  separator-normalized form when that form is a known model, before the
  reset-to-first fallback and before the wired early return.
* The loader nodes declare VALIDATE_INPUTS for the model name input,
  lifting ComfyUI's strict list check for it; the shared helper resolves
  separator-normalized names against the cache, so API-submitted or
  programmatic values validate too. get_checkpoint_info_absolute now
  normalizes backslashes explicitly instead of via os.sep, which was a
  no-op on Linux.
2026-10-17 10:19:53 +08:00
Will Miao e05046af10 fix(loaders): sanitize invalid control_after_generate values when loading old workflows
Old workflows (saved before the control_after_generate feature) carry a
shorter widgets_values array. The frontend's index-based widget restore
then shifts the old weight_dtype value into the hidden control widget
(leaving an invalid value like 'default') and silently resets
weight_dtype to its default. On graph load, hand the shifted value back
to weight_dtype when it still sits at its default, then reset the
control mode to 'fixed' so old workflows keep loading deterministically.
2026-08-25 08:30:17 +08:00