Commit Graph

5435 Commits

Author SHA1 Message Date
Matt Miller f4e51b9ef9 refactor(jobs): return NamedTuple page, early-out on empty job set
Review feedback on the jobs cursor pagination:
- get_all_jobs now returns JobsPage, a NamedTuple, instead of a bare
  4-tuple (callers unpack positionally either way).
- Early-out when the filtered job set is empty so paging code never has
  to reason about indexing into an empty list. A malformed 'after'
  cursor is still decoded first and rejected with INVALID_CURSOR.
- Document that job ids are server-assigned UUIDs, always present and
  unique — the empty-string fallback in _job_id_key only shields
  sorted() from a malformed dict, it is not part of the keyset
  contract.
2026-06-09 21:19:51 -07:00
Matt Miller a8b24cb0bb feat(jobs): cursor-based pagination on GET /api/jobs (BE-943)
Mirror the cloud jobs cursor (BE-885) on the OSS Python server so the
frontend sees one contract across runtimes.

- apply_sorting now appends the job id as a tiebreaker, making (create_time,
  id) a stable keyset; without it, ties could reorder between pages.
- get_all_jobs accepts an opaque 'after' cursor (honored only for created_at
  sort, like cloud), keyset-filters the sorted in-memory list, and returns
  has_more + a next_cursor. Minted in offset mode too so a client can bootstrap
  into keyset pagination.
- server.py /api/jobs parses 'after', returns next_cursor in the pagination
  object, and maps a malformed cursor to 400 INVALID_CURSOR.
- Reuses the shared utils.cursor codec (base64url JSON {s,v,id,o}) so the wire
  format matches cloud and assets exactly.

Tests: asc/desc multi-page round-trip, same-create_time tiebreaker, last-page
no-cursor, offset-mode bootstrap, execution_duration ignores cursor, malformed
cursor raises.
2026-06-09 21:16:24 -07:00
Matt Miller ba8ea12922 refactor(pagination): hoist cursor codec to utils/ for cross-domain reuse
The keyset cursor codec was asset-namespaced (app/assets/services/cursor.py)
but the wire format and encode/decode logic are domain-agnostic. Move it to
utils/cursor.py so the jobs endpoint can share one codec instead of importing
across domains or duplicating it.
2026-06-09 21:16:24 -07:00
guill 71a20886ec
Merge branch 'master' into matt/be-944-core-cursor-based-pagination-for-get-apiassets 2026-06-09 21:07:47 -07:00
Matt Miller a76bb4380e
chore(assets): drop vestigial tags.tag_type column (#14248)
tag_type was always "user" in practice — no code path ever set it to anything
else (no system/seeded classification was wired up) and nothing queried it. The
column, its ix_tags_tag_type index, and the TagUsage.type API field were dead
weight, so they're removed. Adds alembic migration 0004 to drop the column and
index.

Verified: asset-seeder tests pass; migration applies cleanly on a fresh SQLite
(tags retains only name; tag_type column + index dropped).

Co-authored-by: guill <jacob.e.segal@gmail.com>
2026-06-09 21:07:10 -07:00
Matt Miller 36e0d4fae9
Merge branch 'master' into matt/be-944-core-cursor-based-pagination-for-get-apiassets 2026-06-09 21:05:32 -07:00
Matt Miller 9341fc6894 refactor(assets): drop cross-runtime cursor escaping; cursors are opaque
The custom JSON escaping of <, >, &, U+2028, and U+2029 existed only to
keep the encoded cursor byte-identical with the Cloud implementation of
the same payload format. Cursors are opaque tokens, so byte-level
compatibility across implementations is not needed — plain json.dumps
output is sufficient. Remove the escaping helper and the byte-identity
test fixtures that pinned the wire format; keep round-trip coverage for
the affected characters.
2026-06-09 20:55:40 -07:00
Kohaku-Blueleaf f350acdf21
[Trainer/bug] Ensure model is not inference mode (CORE-72) (#13400)
* Ensure model is not inference mode

* force clone inside training mode to avoid inference tensor

* Allow force deepcopy for model patcher
2026-06-09 23:07:47 -04:00
Comfy Org PR Bot 46d45aade1
chore(openapi): sync shared API contract from cloud@ca12913 (#14367) 2026-06-10 09:58:42 +08:00
comfyanonymous 5fcf7a4a0f
Always enable cuda malloc on cu130 and higher. (#14381) 2026-06-09 21:39:24 -04:00
Talmaj 5ece24e73c
Depth anything 3 (Core-135) (#13853)
Co-authored-by: Alexis Rolland <alexisrolland@hotmail.com>
2026-06-10 09:28:24 +08:00
Jukka Seppänen f8e51b674c
feat: Add Bernini-R model support (Wan video) (CORE-279) (#14216) 2026-06-10 07:47:34 +08:00
Kohaku-Blueleaf ad564899d3
Ensure conditions are not trainable to avoid bugs (#14368) 2026-06-09 15:55:29 -04:00
rattus 6f01b244a2
mm: dont reset cast buffers in cleanup_models_gc() (#14372)
cleanup_models_gc can be called once per load_models_gpu via
free_memory, which in turn can de-activate an active model via
this reset_cast_buffers.

cleanup_models_gc() could also come via obscure garbage collector
paths so limit reset_cast_buffers to the post-node callsite instead.
2026-06-09 13:57:04 -04:00
Alexis Rolland 9fc6f5f6dd
Move bg_removal_model input socket to first position for nicer display (#14353) 2026-06-09 23:36:56 +08:00
Jukka Seppänen 184009c2f6
feat: Add model support for SCAIL-2 (#14373)
* initial SCAIL2 support
2026-06-09 18:24:09 +03:00
kelseyee 07c53f8f0f
Add LoRA key mapping for LTXV/LTXAV models (#14349) 2026-06-09 09:57:58 -04:00
rattus 1639dc7a70
main/server: Add --debug-hang (#14371)
Add an option to debug a hang with ctrl-C, dumping the backtraces to
see where its stuck or slow.
2026-06-09 09:55:00 -04:00
Jukka Seppänen 8ed7f458d0
Allow custom templates with Ideogram4 TE (#14374) 2026-06-09 21:11:05 +08:00
Alexis Rolland f89999289a
fix: Add back apply_rotary_emb for Qwen Image (#14364) 2026-06-09 11:55:49 +08:00
Comfy Org PR Bot cb9f639416
chore(openapi): sync shared API contract from cloud@5273c30 (#14266) 2026-06-09 11:19:13 +08:00
Matt Miller f7558232fa refactor(assets): extract cursor JSON escaping helper; size wire cap above per-field caps
Addresses review feedback on cursor.py:

- Extract the inline escape chain into _apply_wire_compatible_json_escapes()
  with a comment pinning it to the wire format's escape set, so the parity
  intent is explicit rather than reading as an ad-hoc transform.
- Raise MAX_ENCODED_CURSOR_LENGTH to 8192 (comfortably above the ~5.2KB
  worst-case the per-field caps can produce) and drop the mint-time length
  guard. Encoder/decoder symmetry now holds by construction: the encoder
  can't produce a cursor the decode path rejects, so there is no confusing
  user-visible 'cursor too long' failure at mint time.
- Rewrite the two over-wire-cap tests to assert worst-case multibyte and
  escape-heavy values mint and round-trip, instead of being rejected.
2026-06-08 16:56:10 -07:00
Matt Miller 546d7d2eb6 Merge remote-tracking branch 'origin/master' into matt/be-944-conflict-resolve
# Conflicts:
#	openapi.yaml
2026-06-08 16:35:55 -07:00
comfyanonymous 00b633f368
Revert "Add SeedVR2 support (CORE-6) (#14110)" (#14359)
This reverts commit 7863cf0e53.
2026-06-08 18:00:20 -04:00
Matt Miller a0a055bc4e
feat(assets): extract image dimensions at ingest and emit on asset responses (#13991)
* feat(assets): extract image dimensions at ingest and emit on asset responses

Image assets now carry width/height under the existing `metadata` field on
asset responses, shaped as `{"kind": "image", "width": W, "height": H}`.
This lets consumers get original dimensions (e.g. for clients that render
server-side thumbnails and can't recover them from naturalWidth/Height)
without an extra round-trip.

Dimensions are written to AssetReference.system_metadata across three
ingest paths:

- Direct file ingest (upload, in-place registration): Pillow reads the
  image header right after hashing, while the file is still in OS page
  cache. Non-image MIME types are skipped without touching the file.
- From-hash registration: this path never reads the file bytes, so
  dimensions are best-effort copied from any prior sibling reference of
  the same asset that already carries kind=image metadata. Missing
  siblings, non-image siblings, or absent dimension keys leave the new
  reference's metadata unchanged.
- Scanner enrichment: extends the existing system_metadata write in
  enrich_asset so scanner-registered images get the same treatment as
  uploaded ones.

Existing system_metadata keys (e.g. safetensors fields written by the
enricher, download provenance) are preserved through merge. Existing
assets ingested before this change retain their current metadata — no
automatic backfill in this PR.

Tests cover image emission, non-image no-op, merge preservation, and the
from-hash sibling back-fill (including the no-sibling and non-image-sibling
cases).

* fix(assets): validate sibling dimensions before backfilling

Per CodeRabbit review on #13991: the previous loop accepted any sibling
with `kind == "image"` and copied whichever dimension keys happened to
be present, then returned. A partial sibling (kind set but missing or
invalid width/height) could persist incomplete metadata onto the new
reference even when a later sibling had valid dimensions.

Now we validate that the sibling has both width and height as positive
integers before adopting its dimensions, and continue scanning to the
next sibling otherwise.

* fix(assets): reject booleans in sibling dimension validation (use type-is)

Per CodeRabbit follow-up on #13991: bool is a subclass of int in Python,
so isinstance(True, int) is True. The previous strict-int gate would
have accepted width=True (truthy + > 0) as a valid dimension.
Realistic occurrence is low (extract_image_dimensions returns proper
ints, JSON doesn't serialize bools as numbers), but the validation gate
exists for defense-in-depth so it should be actually strict.

---------

Co-authored-by: guill <jacob.e.segal@gmail.com>
2026-06-08 14:27:50 -07:00
Silver a1c434eb65
Improve ResolutionSelector (#14309) 2026-06-09 01:05:10 +08:00
Jukka Seppänen fc258b10e5
Add Color primitive (#14260) 2026-06-09 00:30:28 +08:00
Daxiong (Lin) 38f750d80e
chore: update embedded docs to v0.5.3 (#14350) 2026-06-08 22:58:52 +08:00
John Pollock 7863cf0e53
Add SeedVR2 support (CORE-6) (#14110) 2026-06-08 18:15:05 +08:00
comfyanonymous 739061dd4c
Use windows line endings for windows portable readmes. (#14334) 2026-06-07 23:56:53 -04:00
comfyanonymous 2cdaaf4a25
Update line endings check to ignore .ci files. (#14319) 2026-06-06 19:33:03 -07:00
Terry Jia ea36cb16d6
feat(3d): reorder Preview3DAdvanced / PreviewGaussianSplat / PreviewPointCloud inputs and outputs (#14308) 2026-06-05 19:01:57 -07:00
Terry Jia a65a5464c7
BE-1172 fix(3d): save Preview3DAdvanced / PreviewGaussianSplat / PreviewPointCloud to temp/, rename viewport input (#14294) 2026-06-05 14:18:41 -07:00
comfyanonymous 986ce5b4f0
Update AMD portable readme. (#14303) 2026-06-05 12:41:44 -07:00
Terry Jia 2ef2cf1a7c
feat: add PreviewGaussianSplat + PreviewPointCloud nodes (#14194) 2026-06-05 12:30:58 -07:00
Alexander Piskun aeee53ff6a
[Partner Nodes] feat: add temperature and top_p to NanoBanan node (#14305) 2026-06-05 11:52:15 -07:00
Alexander Piskun 4a00126e9c
[Partner Nodes] feat: add new Gemini text node (#14299) 2026-06-05 10:31:55 -07:00
rattus ec6aa979a6
aimdo 049 (#14300) 2026-06-05 08:40:03 -07:00
rattus 410df27253
Fix interoperation with external source of pinned memory pressure (#14252)
* mm: split off registration helper to doer and headroom calc

* pinned_memory: implement registration comfy side

Move away from Aimdo buffer registrations which seem fraught with
danger and do it comfy side. Just start with the basic move.

* pinned_memory: do registrations as portable memory

* pinned_memory: discard async errors on registration fail

Like the good ol days.

* pinned_memory: implement abs shortfall retry

If pinned registration happens to fail despite the previous budget
ensures, consider the allocation shortfall, ensure it again, and
try again. This allows comfy pins to interoperate with other software
that might be doing substantive pinning.
2026-06-05 08:39:35 -07:00
Jukka Seppänen 5aa71b9bc2
Enable cfg1 optimization for DualModelGuider with CFGGuider (#14290)
* Enable cfg1 optimization for DualModelGuider

* Fix CFG Override tooltip
2026-06-05 10:04:10 +03:00
Alexis Rolland ab0d8a9203
Consolidate audio nodes into SaveAudioAdvanced node (CORE-202) (#13871) 2026-06-04 19:29:41 -07:00
comfyanonymous 514bb8ba21
Fix ideogram if model dtype gets set to fp8. (#14291) 2026-06-04 19:20:22 -07:00
Comfy Org PR Bot 4e1f7cb1db
Bump comfyui-frontend-package to 1.45.15 (#14265) 2026-06-04 11:41:33 -07:00
Daxiong (Lin) 6ecca5f468
chore: update workflow templates to v0.9.98 (#14284) 2026-06-04 09:40:44 -07:00
Alexander Piskun 27b5c423a6
[Partner Nodes] feat: add seed input to Flux Erase node (#14283)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
2026-06-04 19:32:15 +03:00
Alexander Piskun 1f9e7df52a
[Partner Nodes] feat: add Krea 2 Medium Turbo model (#14280) 2026-06-04 08:24:22 -07:00
Alexander Piskun 0a92dd9c09
[Partner Nodes] feat: add Bria Green Background node (#14277) 2026-06-04 07:47:20 -07:00
Alexander Piskun 4d360f9c9d
[Partner Nodes] fix (Seedance 2.0): prevent 1080p first/last-frame stretch jump (#14251)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
2026-06-04 11:23:52 +03:00
Alexander Piskun 4f99ce0f8c
[Partner Nodes] fix SaveWEBM node to save alpha channel; add BriaTransparentVideoBackground Partner node (#14257) 2026-06-03 16:05:48 -07:00
Yousef R. Gamaleldin 7758b9b321
fix: Image grid bug fix (CORE-215) (#14100) 2026-06-03 16:03:32 -07:00