Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
6018efe
feat(skills): add comfy-run-on-cloud skill and a build inventory command
shengkaisun Oct 14, 2026
246f09f
feat(skills): lossless-vs-lossy conversion policy for comfy-run-on-cloud
shengkaisun Oct 20, 2026
b0895aa
Merge remote-tracking branch 'origin/main' into esun/feat/run-on-clou…
shengkaisun Oct 20, 2026
adb1e46
docs(skills): convert a build's smoke-run workflow with the build's o…
shengkaisun Oct 20, 2026
23d6a4d
fix(skills): verify workflow scope, approvals and update targets
shengkaisun Oct 21, 2026
be7aaaf
fix(discovery): report Desktop installs and missing workspaces
shengkaisun Oct 21, 2026
1481551
test(discovery): expect missing-workspace warnings in manager reports
shengkaisun Oct 21, 2026
26b7bb5
fix(auth): coalesce peer refreshes and preserve watch recovery
shengkaisun Oct 21, 2026
d5affe4
fix(build): validate public pins during dry runs
shengkaisun Oct 21, 2026
8a89ba4
fix(workflow): persist Cloud sidebar files and verify save identity
shengkaisun Oct 21, 2026
a44961c
docs: align run-on-cloud skill with simple agent handoff
shengkaisun Oct 21, 2026
06ff912
fix(skills): reuse compatible builds before cloud conversion
shengkaisun Oct 23, 2026
7a0767a
feat(cloud): validate workflow handoffs, imports and environment iden…
shengkaisun Oct 25, 2026
286be33
Merge remote-tracking branch 'origin/main' into esun/feat/run-on-clou…
shengkaisun Oct 25, 2026
012e568
Merge remote-tracking branch 'origin/esun/fix/transient-401-code' int…
shengkaisun Oct 25, 2026
617cc1d
Merge remote-tracking branch 'origin/esun/fix/dry-run-pin-check' into…
shengkaisun Oct 25, 2026
c51df78
Merge remote-tracking branch 'origin/esun/fix/workflow-save-sidebar' …
shengkaisun Oct 25, 2026
57161ba
fix(discovery): resolve the running Desktop instance paths
shengkaisun Oct 25, 2026
7b17e5f
Merge remote-tracking branch 'origin/esun/fix/which-desktop-install' …
shengkaisun Oct 25, 2026
03507cd
Merge branch 'esun/fix/desktop-runtime-roots' into esun/feat/run-on-c…
shengkaisun Oct 25, 2026
4172d4d
docs(adr): record verified cloud handoff contracts
shengkaisun Oct 25, 2026
86fc48d
docs(adr): keep lifecycle metadata before relation prose
shengkaisun Oct 25, 2026
371bfe8
fix(models): refuse unverified public collision listings
shengkaisun Oct 25, 2026
ae2b93e
Merge remote-tracking branch 'origin/main' into esun/fix/desktop-runt…
shengkaisun Oct 25, 2026
db7e0db
docs(adr): define read-only Desktop path identity
shengkaisun Oct 25, 2026
fbb4d72
test(output): pin terminal behavior in Rich fixtures
shengkaisun Oct 25, 2026
218824a
Merge branch 'esun/fix/desktop-runtime-roots' into esun/feat/run-on-c…
shengkaisun Oct 25, 2026
3577a70
fix(deploy): make recovery reads work outside a spec
shengkaisun Oct 25, 2026
a56bd15
test(which): provide an existing workspace for schema validation
shengkaisun Oct 25, 2026
d912607
Merge branch 'esun/fix/desktop-runtime-roots' into esun/feat/run-on-c…
shengkaisun Oct 25, 2026
e5f351a
test(cli): compare visible option names in colored help
shengkaisun Oct 25, 2026
531a95c
Merge main into Run on Cloud handoff branch
shengkaisun Oct 27, 2026
1a96cf3
Merge branch 'main' into esun/fix/workflow-save-sidebar
wealthwiselabs Oct 28, 2026
4799e69
fix(inventory): reject malformed legacy model roots
shengkaisun Oct 28, 2026
4f47364
Merge origin/main into run-on-cloud skill
shengkaisun Oct 28, 2026
fe4acd5
fix(workflow): preserve JSON types when verifying mirrored records
shengkaisun Oct 28, 2026
78cd9db
fix(workflow): compare mirrored JSON without bool-number coercion
shengkaisun Oct 28, 2026
45b878e
test(cli): isolate preflight catalogs and platform trust fixtures
shengkaisun Oct 28, 2026
0efcc8f
fix(inventory): retain reports when optional responses exceed byte caps
shengkaisun Oct 28, 2026
40d64f7
fix(desktop): clear unverified process interpreter
shengkaisun Oct 29, 2026
891511a
fix(desktop): verify server filesystem provenance
shengkaisun Oct 29, 2026
ddca4ab
fix(desktop): reject unresolved drive-relative server scripts
shengkaisun Oct 29, 2026
6354b00
Merge origin/main into Run on Cloud handoff
shengkaisun Oct 29, 2026
d59861a
Merge latest main Load3D layout fix
shengkaisun Oct 29, 2026
c3cea95
Merge main Load3D edit normalization
shengkaisun Oct 29, 2026
4dd7878
fix(discovery): preserve selected workspace and sanitize display
shengkaisun Oct 29, 2026
f227725
test(discovery): use portable workspace fixture paths
shengkaisun Oct 29, 2026
e71f897
Merge main watch polling and workflow updates
shengkaisun Oct 29, 2026
9dd8a67
Verify private workflow links by stable saved-file UUID
shengkaisun Oct 30, 2026
e0c90be
Expose userdata saved-file UUID separately from workflow records
shengkaisun Oct 30, 2026
95a3564
Keep sanitized HTTP status in saved-file link refusals
shengkaisun Oct 30, 2026
8d8fd01
Merge saved-file UUID output while preserving standalone workflow fixes
shengkaisun Oct 30, 2026
adcd3e3
Retain distinct legacy-surface link regression scenarios
shengkaisun Oct 30, 2026
e0cfd9b
Match saved-file UUID receipts to the frontend consumer contract
shengkaisun Oct 30, 2026
65f9be5
Match saved-file link paths and UUIDs to the frontend decoder
shengkaisun Oct 30, 2026
a86c5a5
Merge shared frontend-compatible saved-file UUID validation
shengkaisun Oct 30, 2026
c142b63
Register saved-file identity warning as a navigation signal
shengkaisun Oct 30, 2026
fa4df71
Merge saved-file identity warning registration
shengkaisun Oct 30, 2026
2024c3b
chore: merge main into Run on Cloud handoff
shengkaisun Oct 31, 2026
dee34ca
test(run): isolate UI workflow preflight catalog
shengkaisun Oct 31, 2026
1d6d3f5
chore: merge latest main workflow sockets and model destinations
shengkaisun Oct 31, 2026
c782f9f
docs: clarify saved userdata identity in changelog
shengkaisun Oct 31, 2026
5317dc5
chore: merge main and retain Run-on-Cloud changelog
shengkaisun Nov 2, 2026
f2d3800
fix: reconcile Run on Cloud with account-bound asset uploads
shengkaisun Nov 2, 2026
958ac1f
fix(auth): bound watch recovery and reject unusable peer tokens
shengkaisun Nov 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 128 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,62 @@ history.

### Added

- `comfy knowledge resolve` suggests canonical model ids for an incomplete
family/version name such as `Qwen 2.1`. The command still fails with
`knowledge_unknown_model` and exit 1, but `error.details.candidate_ids` lists
up to five sorted, distinct ids whose id or alias has the same family word
and the same numeric components in order, and the hint names them and asks
which model is intended before retrying `comfy knowledge resolve <exact-id>`.
A single candidate is still only a suggestion: nothing is auto-resolved,
downloaded or run. Substituted family words, different versions and names
with non-ASCII letters or digits get no candidates. Exact id and alias
resolution, `close_matches` and the hint for a name with no candidates are
unchanged.

- `comfy model upload` previews an import into the standard environment and
uploads only the approved file digest to the approved workspace. It verifies
model-folder capabilities, collisions and returned content identity, and sends
a private snapshot of the approved bytes.

- Read-only `comfy deploy ui` and `comfy workflow ui` return editor links only
after checking the workspace, supported capability and exact saved target.
Workflow links require a matching normal saved document and explicitly select
the requested standard or custom environment. Canvas validation follows the
frontend schemas and WHATWG URL semantics for model metadata.

- A `comfy-run-on-cloud` skill, installed by default, takes one local workflow
onto Comfy Cloud. It checks Comfy Cloud's standard environment with the
original dependencies, including supported user model/LoRA uploads, then
reuses a compatible existing custom environment (a workspace Build) before
considering conversion. Lossless conversions (the same file in another folder,
removing memory- or speed-only nodes, exact core equivalents) happen without
asking; a lossy one (a different model, LoRA, upscaler or implementation)
needs the user's yes, with a custom environment offered as the exact alternative and
its costs stated. It pre-flights every converted copy on the server, asks once
per file before uploading models or inputs from disk on every route, and
verifies a real job on the selected target before handoff. It asks before freeing
a release, Build or deployment slot only when the planned operation needs it.
Its reference skill `comfy-run-on-cloud-local-install` covers finding the install behind a
workflow, Comfy Desktop's split layout included.

- `comfy build inventory <workflow>` (hidden while the skill above is its only
caller) reports what one workflow loads: active classes and the packs and
versions it recorded, model values with their subfolders, `embedding:`
references, input files, muted and bypassed nodes, and loaders that pull
weights no widget names. `--models-root` (repeatable), `--desktop` and
`--hash` find each model on disk; `--input-root` hashes each input file to the
name Cloud stores an upload of it under; `--server` joins a running ComfyUI's
classes. `--cloud` reports `covered`, `covered_after_lossless_fixes` (folder
remaps with a ready `set_widget`, removable memory-only nodes),
`covered_needs_check` or `needs_build_or_lossy_conversion`, compares each
local model's size with Cloud's same-named file (`weights: different_size` is
a different model; matching sizes still require identity verification), and
says whether each input is already on Cloud. Only active subgraph instances
contribute dependencies, each model use is checked against its loader, and
ambiguous input basenames are not guessed. API inventories include the exact
deployment asset-upload plan, including custom-node file inputs, so approvals
can cover every file before a smoke run.

- `comfy assets library upload <file> --type <folder>` puts a `.safetensors`
model file of up to 2 GB into your Comfy Cloud workspace's model library,
e.g. `comfy assets library upload my_style.safetensors --type loras`. The
Expand All @@ -34,17 +90,6 @@ history.
`asset_upload_refused`; new codes `asset_upload_invalid`,
`asset_upload_failed` and `asset_upload_timeout` cover the other ways it
can end.
- `comfy knowledge resolve` suggests canonical model ids for an incomplete
family/version name such as `Qwen 2.1`. The command still fails with
`knowledge_unknown_model` and exit 1, but `error.details.candidate_ids` lists
up to five sorted, distinct ids whose id or alias has the same family word
and the same numeric components in order, and the hint names them and asks
which model is intended before retrying `comfy knowledge resolve <exact-id>`.
A single candidate is still only a suggestion: nothing is auto-resolved,
downloaded or run. Substituted family words, different versions and names
with non-ASCII letters or digits get no candidates. Exact id and alias
resolution, `close_matches` and the hint for a name with no candidates are
unchanged.

### Changed

Expand All @@ -60,9 +105,74 @@ history.

### Fixed

- `comfy assets library ls` reports a 401 or 403 as `cloud_unauthorized` even
when the server drops the connection partway through its error body, instead
of crashing with `IncompleteRead`.
- Run-on-Cloud inventories resolve the selected Desktop instance's effective
paths, retain uncertain dependencies, distinguish runtime inputs from model
coverage, and report missing or conflicting model identity. Verified private
models now pass Cloud model-enum preflight without relaxing other validation.

- Run-on-Cloud guidance reuses compatible Builds before conversion, binds file
approval to the reviewed bytes and destination, and stops build repair when
the proposed package has no verified installation mechanism. The installed
wheel now includes the skill's prompt template.

- Successful previews using bundled ffmpeg no longer report a false trust error.
Cloud asset listings encode multiple tags using the server's supported query
format, and CLI subprocess tests isolate their credential stores.

- Desktop discovery reads both modern and legacy registries. Callers with
running-server launch metadata select that exact instance, resolve its model
YAML and effective data/input/output paths, and keep ambiguous or relative
runtime identities unresolved. The optional discovery fields are documented
in the which/env schemas; unrelated launch arguments are excluded.

- Parallel build and deploy requests rejected on an old access token now adopt
a peer's refreshed token under the shared refresh lock instead of rotating it
again. Each rejected request retries at most once. If session recovery still
fails while a refreshable sign-in remains stored, the watch reports that the
remote work may continue instead of telling you to sign in again.
`comfy build release create --watch`, `comfy deploy up`, `promote`,
`rollback` and `comfy deploy status --watch` now end with the new code
`watch_auth_lost` and exit code 75, as `deploy_watch_lost` does. Its hint
names the command that reads the release or deployment again. A 401 before
anything was accepted, on a workspace API key, or when no refreshable sign-in
remains still reports `build_not_signed_in` or `deploy_not_signed_in`.

- `comfy build push --dry-run` now runs the push's registry-pin check, so a
pin the builder cannot place fails the dry run with the push's own
`build_registry_pin_missing` error instead of passing it. A version the
registry has Flagged was the common case: the dry run passed, and the push
was refused only after the plan had been disclosed. The check asks the
builder's snapshot importer to place each public pack, a read that writes
nothing, and the dry run still uploads and saves nothing. A spec that pins
a public pack now needs sign-in for its dry run (`build_not_signed_in`
otherwise); a spec whose packs are all local still sends no request.

- `comfy workflow save --where cloud` saves the workflow where the Cloud
Workflows sidebar lists it, as `workflows/<name>.json`, so it shows there and
opens from it. It used to create only an `/api/workflows` record, which the
sidebar never shows. Cloud keeps a record for the file, and `workflow_id` and
`latest_version` are read back from it by name; when exactly one record by
that name with matching content can't be read back they are null, with a
`workflow_record_unresolved` warning, and the save still succeeds. `--json`
also carries `filename`, `size` and `modified`. `saved_file_id` identifies
the actual userdata file, separately from `workflow_id`; it is null with
`saved_file_identity_unavailable` when the server write receipt cannot
certify it. A same-name save replaces the
workflow, as the Cloud editor's Save does, where it used to add a second
record with the same name; the new `--no-overwrite` refuses it with
`workflow_exists` instead, on both routes. On Cloud `--description` is now
ignored with a `description_ignored` warning, since the file has no
description field. A save named `.index.json`, the folder's favorites file,
is refused, as are Cloud dotfiles or hidden folders that the sidebar never
lists. Cloud deletion now removes the sidebar file as well as its record;
ambiguous same-name records are refused before deletion, and partial cleanup
reports `workflow_delete_incomplete` with the file's deletion state.

- `comfy which` and `comfy env` report Desktop's split code, data and model
roots without changing launch/install selection. A nonexistent selected
workspace no longer succeeds in `which`; discovery reports malformed Desktop
configuration and marks inferred data roots as unverified.

- A typed `comfy model download` with no `--relative-path` now saves into the
folder the running local ComfyUI scans for that model type, and says where.
On Comfy Desktop that is the shared library, not the install's `models/`.
Expand Down Expand Up @@ -112,6 +222,10 @@ history.
value. Saves with a real marker have one more value than sockets and still go
through the filter.

- `comfy assets library ls` reports a 401 or 403 as `cloud_unauthorized` even
when the server drops the connection partway through its error body, instead
of crashing with `IncompleteRead`.

## [1.24.0] - 2026-10-29

[Full notes](https://github.com/Comfy-Org/comfy-cli/releases/tag/v1.24.0) · 25 commits since v1.23.0.
Expand Down
2 changes: 1 addition & 1 deletion comfy_cli/agent/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def _cli_invocation() -> str:
path that answered "Access is denied".
"""
argv0 = Path(sys.argv[0] or "")
if argv0.name == "__main__.py":
if argv0.name == "__main__.py" and argv0.parent.name == "comfy_cli":
return f"{Path(sys.executable).name} -m comfy_cli"
name = argv0.name[:-4] if argv0.name.lower().endswith(".exe") else argv0.name
return name if name in _CLI_NAMES else "comfy"
Expand Down
7 changes: 7 additions & 0 deletions comfy_cli/builder_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def __init__(
# handed a token (COMFY_BUILDER_TOKEN, COMFY_CLOUD_AUTH_TOKEN) or a key keeps
# it and lets a 401 surface.
self._refreshes_on_401 = False
self._sign_in_base_url: str | None = None
# What to replace once the builder refuses this client's credential.
self._refused_hint = (
credentials.refused_key_hint(api_key)
Expand Down Expand Up @@ -175,9 +176,15 @@ def from_session(cls, base_url: str) -> BuilderClient:
raise BuilderAuthError("not signed in: run `comfy cloud login` or set COMFY_CLOUD_API_KEY")
client = cls(base_url, session.access_token)
client._refreshes_on_401 = True
client._sign_in_base_url = session.base_url
client._refused_hint = "run `comfy cloud login` first"
return client

@property
def sign_in_base_url(self) -> str | None:
"""The environment of the stored sign-in this client's token came from; None for a key or a handed token."""
return self._sign_in_base_url if self._refreshes_on_401 else None

def _send(self, url: str, **kwargs) -> tuple[int, dict | list | None]:
"""Every builder request goes through here, so a long wait survives its token expiring.

Expand Down
23 changes: 22 additions & 1 deletion comfy_cli/cloud/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ def ensure_fresh_session(
force: bool = False,
allow_clear: bool = True,
expect: Callable[[CloudSession], bool] | None = None,
rejected_access_token: str | None = None,
):
"""Return the stored cloud session, refreshing it first when the access
token is expired (or within ``leeway_s`` of expiring) and a refresh token
Expand All @@ -803,6 +804,10 @@ def ensure_fresh_session(
``expires_at`` recorded — still thinks it is valid. The refresh token is
still required; without one this is a no-op.

``rejected_access_token`` identifies the token that received the 401. If a
peer already replaced it, adopt that session instead of refreshing again.
This also covers a late 401 that arrives after the peer released the lock.

``allow_clear=False`` keeps the stored session on disk even when a refresh
hits a fatal token error (reuse-detection / ``invalid_grant``). Background,
read-mostly callers (the detached ``comfy run`` watcher) pass this so a
Expand Down Expand Up @@ -855,6 +860,7 @@ def ensure_fresh_session(
force=force,
allow_clear=allow_clear,
expect=expect,
rejected_access_token=rejected_access_token,
)
except TimeoutError:
# A peer has held the lock longer than a refresh should take. Don't
Expand All @@ -875,6 +881,7 @@ def _locked_refresh(
force: bool,
allow_clear: bool = True,
expect: Callable[[CloudSession], bool] | None = None,
rejected_access_token: str | None = None,
):
"""Decide → POST → persist, executed while holding the secrets lock.

Expand All @@ -890,11 +897,25 @@ def _locked_refresh(
if session is None or not session.refresh_token:
return session

# The rejected request may have been in flight while a peer finished its
# refresh, before even our first store read. Don't rotate that peer's token
# again just because this client's older request was refused.
if (
rejected_access_token is not None
and session.access_token != rejected_access_token
and session.expires_at is not None
and not session.is_expired(leeway_s=leeway_s)
):
return session

# Double-check after acquiring the lock. A peer may have refreshed while we
# blocked: if the stored refresh token rotated away from what we observed
# before locking, the family already advanced — use it, never re-send the
# consumed token (that is exactly what trips reuse-detection).
if session.refresh_token != observed_refresh_token:
# A usable reactive peer already returned above. Otherwise refresh its
# current family, never replaying the older token observed before locking.
# Ordinary proactive callers still coalesce on any peer rotation.
if session.refresh_token != observed_refresh_token and rejected_access_token is None:
return session
if not force and not session.is_expired(leeway_s=leeway_s):
# Peer advanced the access token's expiry without us noticing a token
Expand Down
Loading
Loading