Skip to content

Comments

Assets Part 2 - add more endpoints#12125

Merged
comfyanonymous merged 45 commits intomasterfrom
assets-redo-part2
Jan 31, 2026
Merged

Assets Part 2 - add more endpoints#12125
comfyanonymous merged 45 commits intomasterfrom
assets-redo-part2

Conversation

@Kosinkadink
Copy link
Member

@Kosinkadink Kosinkadink commented Jan 27, 2026

This PR adds the code for asset-related endpoints that the frontend can start using + enhancing. This API is still under construction, so any custom node developers should not use it yet.

Input/output scanning is not included yet, as the fast scans do take ~1 second when the amount of assets gets to 15k . However, that can be solved with an incremental PR that will make the scans happen on a separate thread that will keep the /object_info (and startup) calls from being delayed.

About ~2400 of the added lines are tests.

Endpoints present now:

  • Existing:
    • @ROUTES.get("/api/assets")
    • @ROUTES.get(f"/api/assets/{{id:{UUID_RE}}}")
  • New:
    • @ROUTES.head("/api/assets/hash/{hash}")
    • @ROUTES.get(f"/api/assets/{{id:{UUID_RE}}}/content")
    • @ROUTES.post("/api/assets/from-hash")
    • @ROUTES.post("/api/assets")
    • @ROUTES.put(f"/api/assets/{{id:{UUID_RE}}}")
    • @ROUTES.delete(f"/api/assets/{{id:{UUID_RE}}}")
    • @ROUTES.get("/api/tags")
    • @ROUTES.post(f"/api/assets/{{id:{UUID_RE}}}/tags")
    • @ROUTES.delete(f"/api/assets/{{id:{UUID_RE}}}/tags")
  • Temporary for tests until input/output roots are included in scan:
    • @ROUTES.post("/api/assets/seed")

…for now, make posting assets endpoint inaccessible with a 501
@Kosinkadink Kosinkadink changed the title Assets redo part2 Assets Part - add more endpoints Jan 28, 2026
@Kosinkadink Kosinkadink marked this pull request as ready for review January 28, 2026 00:51
@Kosinkadink Kosinkadink changed the title Assets Part - add more endpoints Assets Part 2 - add more endpoints Jan 28, 2026
@socket-security
Copy link

socket-security bot commented Jan 30, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedblake3@​1.0.899100100100100

View full report

Kosinkadink and others added 6 commits January 29, 2026 17:37
* Not sure about this one, but try removing assets from old sessions.

* Simplify _prune_orphaned_assets: merge functions, use list comprehensions

Amp-Thread-ID: https://ampcode.com/threads/T-019c0917-0dc3-75ab-870d-a32b3fdc1927
Co-authored-by: Amp <amp@ampcode.com>

* Refactor _prune_orphaned_assets for readability

Amp-Thread-ID: https://ampcode.com/threads/T-019c0917-0dc3-75ab-870d-a32b3fdc1927
Co-authored-by: Amp <amp@ampcode.com>

* Add unit tests for pruning

* Add unit tests for _prune_orphaned_assets

Tests cover:

- Orphaned seed assets pruned when file removed

- Seed assets with valid files survive

- Hashed assets not pruned even without file

- Multi-root pruning

- SQL LIKE escape handling for %, _, spaces

Amp-Thread-ID: https://ampcode.com/threads/T-019c0c7a-5c8a-7548-b6c3-823e9829ce74
Co-authored-by: Amp <amp@ampcode.com>

* Ruff fix

---------

Co-authored-by: Amp <amp@ampcode.com>
@comfyanonymous comfyanonymous merged commit 6ea8c12 into master Jan 31, 2026
14 checks passed
simonri pushed a commit to simonri/ComfyUI-flash-attention-3 that referenced this pull request Feb 2, 2026
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.

3 participants