Commit Graph

5565 Commits

Author SHA1 Message Date
Simon Pinfold
8da4669172 fix(assets): don't hit uninitialized database from /view hash resolution
With --disable-assets (or after a database init failure) init_db() never
runs and Session stays None, but /view?filename=blake3:<hash> still
called resolve_hash_to_path(), raising TypeError and returning a 500.
Workflows saved while assets were enabled trigger this on preview render
in disabled mode. Gate the hash branch on live assets availability and
return 404, which also fixes the pre-existing 500 on the degraded path.

Also copy output_ui in the disabled enrichment fast path so the
'returns a new dict' contract holds in both modes.
2026-07-28 09:22:57 +12:00
Simon Pinfold
b7c58c8371 fix(assets): harden --disable-assets from review feedback
- setup_database() also calls disable_assets_routes() so the off state
  does not depend on PromptServer construction order, and logs a notice
  when the deprecated --enable-assets no-op is passed alongside
- disabled-mode test fixture: fail fast if the server process exits
  during startup instead of burning the 90s readiness timeout, kill the
  process if terminate() hangs, and close log handles if Popen raises
- disabled enrichment test also asserts registration is never attempted
2026-07-28 08:47:42 +12:00
Simon Pinfold
d1014a5f92 feat(assets): add --disable-assets flag to turn the assets system off
With --enable-assets removed and the assets system always on, there is no
supported way to run without it. Add an explicit opt-out for the rollout
bake period: cloud multi-tenant sidecars need a guaranteed off-switch, and
QA needs a clean-fallback configuration.

When --disable-assets is passed:
- asset API routes are registered but disabled, returning a structured 503
- database initialization is skipped entirely (no sqlite file is created;
  the database currently has no non-asset users)
- the background seeder is disabled, covering startup, /object_info and
  post-execution enrich scans, and output registration
- workflow output enrichment and /upload/image asset registration are
  skipped
- the assets feature flag reports false, and supports_model_type_tags
  follows it since model_type tags are an assets-API capability

The hidden --enable-assets no-op remains accepted for launcher
compatibility; --disable-assets takes precedence since the former gates
nothing.
2026-07-28 05:44:53 +12:00
Matt Miller
c78d436b4e Merge origin/master into matt/be-786-phase-1-remove-enable-assets-from-oss-assets-always-on-cloud
Resolve server.py conflict: keep ungated asset registration (this PR)
while preserving master's subfolder tag support via get_known_subfolder_tags.
2026-07-08 22:41:32 -07:00
Simon Pinfold
55a15f87ce feat(assets): add namespaced model_type tags and align tag semantics (#14511)
* feat(assets): add namespaced model type tags

* fix(assets): mark path-derived upload tags automatic

* fix(assets): merge duplicate scan specs

* test(assets): make duplicate path normalization portable

* feat(assets): add loader_path as the authoritative loader locator (#14796)

* fix(assets): filter model_type tags by bucket extension sets

Buckets sharing a base directory (e.g. diffusion_models and a custom
unet_gguf) tagged every file in the directory regardless of whether the
bucket could load it, so .safetensors files were tagged
model_type:unet_gguf and vice versa. Carry each bucket's registered
extension set through get_comfy_models_folders and only emit a
model_type tag when the file extension matches, keeping the empty-set
match-all convention from folder_paths.filter_files_extensions.

Files under a model base matching no bucket now keep only the models
tag instead of every directory-matching model_type tag.

* feat(assets): replace response file_path with persisted loader_path

The old file_path response field was a namespaced storage locator
(models/checkpoints/foo.safetensors): not an absolute path, not unique
identity, and not the value a loader consumes. Nothing needs that shape
on the wire (hash/ID-based locating is the long-term direction), so it
is dropped rather than renamed; the storage-root matching stays internal,
powering display_name.

What loaders DO need is the in-root loader path (category dropped:
models/checkpoints/foo/bar.safetensors -> foo/bar.safetensors). Serve it
as a first-class loader_path field, persisted on asset_references
(migration 0006) and written by every ingest pipeline at insert, so
responses read the column verbatim.

Like the model_type tags, loader_path is a seed-time derivative of the
model folder registry, maintained by the same scan lifecycle (new files seed
fresh values, pruning retires rows whose bucket disappeared). Rows
predating the column serve a null loader_path; databases from before
this stack already need recreating for the base branch's tag changes.

loader_path resolves every registered base including extra_model_paths
entries; display_name only the canonical storage roots. A file can
therefore be loadable with no display name (extra-path models) or the
reverse (unregistered files under the models root), and loader_path is
null exactly when no loader can resolve the file.

* test(assets): lock loader_path matrix (asymmetry, null, persist/read)

Cover the behaviour that has no production change but is easy to regress:
the extra-path asymmetry (loadable but no storage namespace), null
loader_path persistence for orphan files, and the response reading the
stored column with a compute fallback for un-backfilled rows.

* fix(assets): persist subfolder-qualified loader_path for ingested outputs

ingest_existing_file built its seed spec with the file's basename, so
outputs saved into a subfolder persisted loader_path (and the
user_metadata filename that preview URLs split for their subfolder
param) as just the basename: the served locator pointed at a file that
does not exist at that path. Scanner and seeder specs already derive
fname via compute_loader_path; use the same derivation here.

* fix(assets): only extension-matching buckets contribute a loader_path

The model-base match in get_asset_category_and_relative_path ignored
each bucket's extension set, so a file inside a registered base whose
extension the bucket cannot load (e.g. a .txt uploaded into
model_type:checkpoints) advertised a loader_path that no loader list
would ever resolve, while the tag side of the same stack already
excluded it. Apply the extension check used for backend tags (empty set
accepts any extension), keeping loader_path null exactly when no loader
can resolve the file.

* fix(assets): refresh loader_path when re-ingesting an existing reference

upsert_reference only wrote loader_path on the INSERT branch, so
re-ingesting an existing reference (an output overwritten in place, or a
file re-registered after its loader_path derivation changed) kept the
stale or NULL value forever. Write it on the UPDATE branch too, with a
null-safe change guard so a loader_path difference alone is enough to
trigger the update, and identical values stay a no-op.

* fix(assets): repair semantic merge breakage from #14796 and master

Two textually-clean but semantically-broken merges:

- routes.py lost its folder_paths import when #14796's import block
  superseded the base's, while the content-type hardening added via the
  base's master merge still calls folder_paths.is_dangerous_content_type.
- master's SVG download-hardening test uploads with the pre-namespacing
  bare checkpoints tag, which this branch's destination validation
  rejects; use model_type:checkpoints.

---------

Co-authored-by: guill <jacob.e.segal@gmail.com>
2026-07-08 22:00:08 -07:00
Daxiong (Lin)
6cc814437f Update workflow templates to v0.11.6 (#14834) 2026-07-08 14:04:57 -07:00
Alexander Piskun
24d3ea3265 [Partner Nodes] feat(ByteDance): add Seedream 5 Pro model support (#14832) 2026-07-08 14:04:19 -07:00
j2gg0s
c6cb904994 Fix AttributeError in VAE.is_dynamic() for VAEs constructed without a patcher (#14826) 2026-07-08 16:01:43 -04:00
Silver
091b70edda add models-directory launch argument (#9113) 2026-07-08 22:20:47 +08:00
comfyanonymous
ffbecfffb9 Fix crash when using UNetSelfAttentionMultiply (#14823) 2026-07-07 21:17:31 -07:00
comfyanonymous
b481bc15af Support gqa on all attention backends, drop support for pytorch 2.4 (#14772) 2026-07-07 22:57:52 -04:00
comfyanonymous
6880614319 Update AGENTS.md (#14819) 2026-07-07 18:36:13 -07:00
Barish Ozbay
51bf508a0b feat: Implement basic text overlay node (CORE-137) (#14610) 2026-07-07 21:26:52 +08:00
Alexander Piskun
a3020f107e fix(Video): don't crash on videos with undecodable audio streams (#14746)
* fix(Video): don't crash on videos with undecodable audio streams

Signed-off-by: bigcat88 <bigcat88@icloud.com>

* Update comfy_api_nodes/util/upload_helpers.py

---------

Signed-off-by: bigcat88 <bigcat88@icloud.com>
Co-authored-by: Alexis Rolland <alexisrolland@hotmail.com>
2026-07-07 15:59:49 +03:00
comfyanonymous
7cf4e78335 Delete symlink that breaks our updates. (#14803) 2026-07-06 22:24:05 -04:00
Alexis Rolland
7747c342d4 ci: add CLA Assistant workflow (#14582) 2026-07-07 06:44:19 +08:00
comfyanonymous
439bd807f8 Skip unloading dynamic model patchers in current workflow. (#14799) 2026-07-06 14:35:12 -07:00
Daxiong (Lin)
b08debceca chore: update embedded docs to v0.5.7 (#14783) 2026-07-06 09:56:09 +08:00
comfyanonymous
000c6b784e Small speedup for text model sampling. (#14773) 2026-07-05 18:39:24 -07:00
Alexander Piskun
985fb9d6ad [Partner Nodes] fix(logs-auth): mask authorization headers in logs (#14774)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
2026-07-05 13:55:29 +03:00
Alexis Rolland
7f287b705e fix: Bug when setting transparency in color picker (#14764) 2026-07-04 19:13:38 -04:00
comfyanonymous
b7ba504e06 Try to make coderabbit enforce AGENTS.md (#14759) 2026-07-04 14:25:24 -04:00
Silver
6c62ca0b6b fix: error when embedding is loaded with models using llama_template (#14744) 2026-07-04 17:06:09 +08:00
Robin Huang
3fe9f5fecb Add CLAUDE.md as symlink to AGENTS.md (#14757) 2026-07-04 13:12:47 +08:00
Alexander Piskun
1073a74976 [Partner Nodes] chore(ByteDance): adjust category name (#14752)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
2026-07-04 00:01:05 +03:00
comfyanonymous
de1b8f3e8d Update AGENTS.md (#14738) 2026-07-03 13:08:24 -07:00
Alexander Piskun
77917ed3a6 [Partner Nodes] chore(StabilityAI): remove StabilityAI nodes (#14737)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
2026-07-03 14:24:21 +03:00
Daxiong (Lin)
a04ebe05c2 chore: update workflow templates to v0.11.2 (#14741) 2026-07-03 19:08:11 +08:00
Alexander Piskun
9764381998 [Partner Nodes] feat(ByteDance): add support for Seed Audio 1.0 (#14731)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
2026-07-03 14:00:10 +03:00
comfyanonymous
1e04ced089 Update AGENTS.md (#14733) 2026-07-03 02:08:47 -04:00
Matt Miller
96e0e3585b security: fix four vulnerabilities (GHSA-779p-m5rp-r4h4) (#14734)
* security: fix five vulnerabilities (GHSA-779p-m5rp-r4h4)

- CVE-2026-56670: force download of SVG/XML responses on /view to prevent stored XSS
- CVE-2026-56671: contain /experiment/models/preview reads within the model folder
- CVE-2026-56672: stop inline rendering of uploaded /userdata/{file} content
- CVE-2026-56673: prevent path traversal in get_annotated_filepath (LoadImage /prompt input)
- CVE-2026-56674: reject opaque/null Origin to close the CSRF middleware bypass

Adds regression tests under tests-unit/security_test/ covering all five.

* security: address review feedback on GHSA-779p fixes

- Fix Windows CI failure in test_get_annotated_filepath: compare against
  os.path.abspath(...) to match the intentional abspath normalization added
  by the traversal hardening (abspath prepends the drive letter on Windows).
- origin_check: narrow the bare `except:` in is_loopback() to ValueError so
  genuine interrupts aren't swallowed (review nit).
- origin_check: guard .port access in is_cross_origin_forbidden() so a
  malformed/out-of-range port (e.g. Origin: http://127.0.0.1:99999) fails
  closed with a 403 instead of surfacing an uncaught 500 in the middleware.
- server /view: escape backslash/quote in the Content-Disposition filename
  (RFC 6266 quoted-string) so a filename containing a double quote can't
  malform the response header.

* security: address CodeRabbit review feedback on GHSA-779p tests

- test #3: guard the symlink-escape test with a try/except skip so it no
  longer errors on Windows CI where os.symlink needs elevated privileges /
  Developer Mode (mirrors the guard in the sibling test #2).
- test #5: refresh the stale module docstring to describe the actual /view
  gating (view_image closure calling folder_paths.is_dangerous_content_type,
  the normalising check) instead of the bypassable raw set-membership test.

* revert(security): drop CVE-2026-56674 Origin: null CSRF change

Per maintainer review, the reported CSRF is already mitigated by the pre-existing
Sec-Fetch-Site: cross-site check for current browsers, and the null-origin
rejection risked breaking legitimate sandboxed-iframe embeds. Restores
origin_only_middleware and is_loopback in server.py to their prior state
(the Sec-Fetch-Site check is retained) and removes utils/origin_check.py and its
regression test. The other four GHSA-779p fixes are unaffected.
2026-07-02 20:44:54 -07:00
comfyanonymous
35c1470935 Update AGENTS.md (#14726) 2026-07-02 15:05:55 -04:00
Alexander Piskun
694815f498 [Partner Nodes] chore(Ideogram): remove IdeogramV1 and IdeogramV2 nodes (#14712)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
Co-authored-by: Alexis Rolland <alexisrolland@hotmail.com>
2026-07-02 08:35:11 +03:00
comfyanonymous
92594ca84c Update AGENTS.md with more stuff. (#14725) 2026-07-01 21:55:13 -04:00
Silver
2c935de1b1 Fix Qwen3-VL tokenizer crash with custom embeddings (#14713) 2026-07-01 21:15:07 +03:00
Matt Miller
d224df799b chore(assets): log when assets disabled due to missing DB deps
Addresses CodeRabbit review: the missing-optional-dependency fallback in
setup_database() silently disabled the assets system with no startup
message, unlike the exception path which logs. Add a warning so operators
can tell why /api/assets/* returns 503.
2026-07-01 00:39:43 -07:00
Matt Miller
a5ff07fe63 Merge remote-tracking branch 'origin/master' into matt/be-786-phase-1-remove-enable-assets-from-oss-assets-always-on-cloud 2026-07-01 00:38:27 -07:00
comfyanonymous
dd17debce5 Add some more stuff to AGENTS.md (#14704) 2026-07-01 01:51:51 -04:00
Matt Miller
b369532116 fix(assets): fail safe to 503 when DB unavailable; keep --enable-assets as no-op
Address automated review feedback on the always-on assets change:
- setup_database(): on DB init failure or missing dependencies, call
  disable_assets_routes() + asset_seeder.disable() so /api/assets/* returns a
  clean 503 instead of 500s against an uninitialized DB (restores the fail-safe
  the removed else-branch used to provide).
- feature_flags: derive the advertised 'assets' capability from live backend
  availability instead of hardcoding True, so clients degrade gracefully.
- cli_args: re-add --enable-assets as a hidden deprecated no-op so existing
  launchers still passing the flag don't abort argparse.
- routes: add assets_enabled() accessor for the feature-flag derivation.
2026-06-30 15:25:26 -07:00
Matt Miller
5bcb2b085c Merge branch 'master' into matt/be-786-phase-1-remove-enable-assets-from-oss-assets-always-on-cloud 2026-06-30 14:56:56 -07:00
comfyanonymous
50e5270b86 Add AGENTS.md (#14696) 2026-06-30 17:40:33 -04:00
comfyanonymous
bb131be9e8 ComfyUI v0.27.0 v0.27.0 2026-06-30 17:36:02 -04:00
Matt Miller
a5446a0001 Merge branch 'master' into matt/be-786-phase-1-remove-enable-assets-from-oss-assets-always-on-cloud 2026-06-30 14:28:25 -07:00
Daxiong (Lin)
6fca64780c chore: update workflow templates to v0.11.1 (#14698) 2026-06-30 14:28:09 -07:00
Alexis Rolland
6e11828d10 chore: Update nodes categories (#14674) 2026-07-01 05:20:20 +08:00
Matt Miller
50f33ab900 feat(assets): enable asset system by default; remove --enable-assets
The asset system is now always on. Removes the --enable-assets opt-in
flag and the conditional registration it gated:

- Asset API routes are always registered (with the user manager)
- The background asset scanner always runs (hashing stays opt-in via
  --enable-asset-hashing, default off — no new blake3 cost on a default launch)
- /upload/image asset registration and output enrichment always active
- The "assets" server feature flag is now unconditionally true
- A database-init failure degrades gracefully instead of hard-exiting,
  matching the prior default-path behavior
2026-06-30 14:19:29 -07:00
Alexander Piskun
b70944e710 [Partner Nodes] feat(Google): add Gemini Video Omni node (#14695) 2026-06-30 17:17:53 -04:00
Matt Miller
1c59659a2f feat: make asset hashing opt-in via --enable-asset-hashing, off by default (#14663)
Add a --enable-asset-hashing CLI flag (action=store_true, default False)
and plumb it into the two asset-seeder call sites in main.py that
previously hardcoded compute_hashes=True (the startup scan and the
post-job output enqueue). Local runs now skip blake3 hashing unless the
user opts in, avoiding the startup/per-output cost on large models
directories while keeping hashing available for asset-portability
features.

Co-authored-by: Alexis Rolland <alexisrolland@hotmail.com>
2026-06-30 14:13:20 -07:00
comfyanonymous
d395813bcd Fix memory leak related to int8. (#14697) 2026-06-30 14:08:59 -07:00
Alexander Piskun
8fe0243d97 [Partner Nodes] feat(Google): add Nano Banana 2 Lite model (#14693)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
2026-06-30 11:17:23 -07:00