Skip to content

Fix upscale model loader export bootstrap#148

Draft
pydn wants to merge 5 commits intomainfrom
codex/issue-143-upscale-model-loader
Draft

Fix upscale model loader export bootstrap#148
pydn wants to merge 5 commits intomainfrom
codex/issue-143-upscale-model-loader

Conversation

@pydn
Copy link
Owner

@pydn pydn commented Mar 21, 2026

What this PR solves

This PR fixes workflow export bootstrapping for upscale workflows that reference UpscaleModelLoader or other node classes that are not loaded yet in the current runtime.

Before this change, the exporter decided whether to initialize extra/custom nodes before reading the workflow, which meant it could miss required node mappings and generate incorrect bootstrap code for workflows that depended on those nodes.

What changed

  • read the workflow before deciding whether extra/custom nodes need to be initialized
  • detect missing node classes from the workflow and import extra/custom nodes when needed
  • prefer COMFYUI_PATH when locating ComfyUI so installs outside the repo still resolve imports consistently
  • keep the resolved ComfyUI path at the front of sys.path during setup
  • add regression coverage for an upscale workflow to verify the exported script instantiates UpscaleModelLoader directly instead of falling back to NODE_CLASS_MAPPINGS[...]()

Documentation updates included in this PR

  • refresh the README intro and positioning to better explain the project's purpose
  • document both supported setup paths: installing inside ComfyUI/custom_nodes or running the repo out of tree with COMFYUI_PATH
  • update the Web UI export guidance around Save As Script
  • clarify the CLI export flow, including uv-based setup and command examples
  • add troubleshooting notes for common setup and export issues
  • refresh the README screenshots to match the current UI and docs

Result

Upscale workflows now export with the expected loader bootstrap, out-of-tree ComfyUI installs are discovered more reliably when COMFYUI_PATH is set, and the README now reflects the current setup and usage flow more clearly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants