Commit Graph

100 Commits

Author SHA1 Message Date
Alexander Brown
942b2a6526
Add pruning of Assets not reachable through the current configs (#12168)
Some checks are pending
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
* 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>
2026-01-29 18:34:14 -08:00
Jedrzej Kosinski
1e622d3923 Fixed issues in manager.py that had to do with creating a result after closing the db session 2026-01-29 16:58:48 -08:00
Jedrzej Kosinski
eb78ea0cff Added @ROUTES.post("/api/assets/seed") for now to help with tests 2026-01-29 16:57:37 -08:00
DrJKL
2f0db0e680 Order the tags by when they were added (Ends up being directory depth order)
Some checks are pending
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
2026-01-28 22:17:52 -08:00
DrJKL
69f6c37868 Leave the preview_url blank, don't serialize it as null 2026-01-28 21:49:14 -08:00
Jedrzej Kosinski
25f83d7401 Fixed resolve_asset_content_for_download accessing asset outside of session with statement 2026-01-28 18:57:54 -08:00
Jedrzej Kosinski
2aafb71388 Add node for custom node authors in routes.py 2026-01-28 17:01:29 -08:00
Jedrzej Kosinski
902e84d7ad Remove tags from body of @ROUTES.put(f"/api/assets/{{id:{UUID_RE}}}"), add note about blake3 requirement to test out 2026-01-28 16:04:19 -08:00
Jedrzej Kosinski
d5e6e2a81f Fixed inconsistent spacing in routes.py 2026-01-28 15:39:08 -08:00
Jedrzej Kosinski
e735a8fd85 Satisfy ruff
Some checks failed
Build package / Build Test (3.10) (push) Has been cancelled
Build package / Build Test (3.11) (push) Has been cancelled
Build package / Build Test (3.12) (push) Has been cancelled
Build package / Build Test (3.13) (push) Has been cancelled
Build package / Build Test (3.14) (push) Has been cancelled
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
2026-01-28 15:34:19 -08:00
Jedrzej Kosinski
32ce7a70a7 Removed 501 early returns on endpoints intended to be released, removed @ROUTES.put(f"/api/assets/{{id:{UUID_RE}}}/preview") and @ROUTES.post("/api/assets/scan/seed") and their related schema_in objects 2026-01-28 15:31:06 -08:00
Jedrzej Kosinski
32d4888d99 Fix import for currently unused upload_asset_from_temp_path function 2026-01-27 16:28:05 -08:00
Jedrzej Kosinski
b16390c2fd Made some routes returmn 501's while functionality is worked on
Some checks failed
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Build package / Build Test (3.10) (push) Has been cancelled
Build package / Build Test (3.11) (push) Has been cancelled
Build package / Build Test (3.12) (push) Has been cancelled
Build package / Build Test (3.13) (push) Has been cancelled
Build package / Build Test (3.14) (push) Has been cancelled
2026-01-26 21:02:05 -08:00
Jedrzej Kosinski
4866bbfd8c Comment out import for commented out code 2026-01-26 20:30:20 -08:00
Jedrzej Kosinski
e17542b5c7 Comment out @ROUTES.post("/api/assets/scan/seed") 2026-01-26 20:25:57 -08:00
Jedrzej Kosinski
6a450a8070 Revert seed_assets to only do models root, remove blake3 requirement for now, make posting assets endpoint inaccessible with a 501 2026-01-26 19:28:00 -08:00
Jedrzej Kosinski
facda426b4 Remove extra whitespace at end of routes.py
Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled
Build package / Build Test (3.10) (push) Has been cancelled
Build package / Build Test (3.11) (push) Has been cancelled
Build package / Build Test (3.12) (push) Has been cancelled
Build package / Build Test (3.13) (push) Has been cancelled
Build package / Build Test (3.14) (push) Has been cancelled
2026-01-16 01:04:26 -08:00
Jedrzej Kosinski
65a5992f2d Remove unnecessary logging statement used for testing 2026-01-16 01:02:40 -08:00
Jedrzej Kosinski
287da646e5 Finished @ROUTES.post("/api/assets/scan/seed") 2026-01-16 01:01:49 -08:00
Jedrzej Kosinski
63f9f1b11b Finish @ROUTES.delete(f"/api/assets/{{id:{UUID_RE}}}/tags") 2026-01-16 00:50:13 -08:00
Jedrzej Kosinski
9e3f559189 Finished @ROUTES.post(f"/api/assets/{{id:{UUID_RE}}}/tags") 2026-01-16 00:45:36 -08:00
Jedrzej Kosinski
63c98d0c75 Finished @ROUTES.delete(f"/api/assets/{{id:{UUID_RE}}}") 2026-01-16 00:31:06 -08:00
Jedrzej Kosinski
e69a5aa1be Finished @ROUTES.put(f"/api/assets/{{id:{UUID_RE}}}/preview") 2026-01-16 00:14:03 -08:00
Jedrzej Kosinski
e0c063f93e Finished @ROUTES.put(f"/api/assets/{{id:{UUID_RE}}}") 2026-01-15 23:57:23 -08:00
Jedrzej Kosinski
6db4f4e3f1 Finished @ROUTES.post("/api/assets") 2026-01-15 23:41:19 -08:00
Jedrzej Kosinski
41d364030b Finished @ROUTES.post("/api/assets/from-hash") 2026-01-15 23:09:54 -08:00
Jedrzej Kosinski
fab9b71f5d Finished @ROUTES.head("/api/assets/hash/{hash}") 2026-01-15 21:13:34 -08:00
Jedrzej Kosinski
e5c1de4777 Finished @ROUTES.get(f"/api/assets/{{id:{UUID_RE}}}/content") 2026-01-15 21:00:35 -08:00
Jedrzej Kosinski
e527b72b09 more progress 2026-01-15 18:16:00 -08:00
Jedrzej Kosinski
f14129947c in progress GET /api/assets/{uuid}/content endpoint support 2026-01-14 22:54:21 -08:00
ric-yu
79f6bb5e4f
add blueprints dir for built-in blueprints (#11853) 2026-01-13 16:14:40 -08:00
Jedrzej Kosinski
acd0e53653
Make bulk_ops not use .returning to be compatible with python 3.10 and 3.11 sqlalchemy (#11839) 2026-01-13 00:15:24 -05:00
Jedrzej Kosinski
ec0a832acb
Add workaround for hacky nodepack(s) that edit folder_names_and_paths to have values with tuples of more than 2. Other things could potentially break with those nodepack(s), so I will hunt for the guilty nodepack(s) now. (#11755)
Some checks are pending
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Waiting to run
Execution Tests / test (macos-latest) (push) Waiting to run
Execution Tests / test (ubuntu-latest) (push) Waiting to run
Execution Tests / test (windows-latest) (push) Waiting to run
Test server launches without errors / test (push) Waiting to run
Unit Tests / test (macos-latest) (push) Waiting to run
Unit Tests / test (ubuntu-latest) (push) Waiting to run
Unit Tests / test (windows-2022) (push) Waiting to run
2026-01-08 22:49:12 -08:00
Jedrzej Kosinski
1dc3da6314
Add most basic Asset support for models (#11315)
* Brought over minimal elements from PR 10045 to reproduce seed_assets and register_assets_system without adding anything to the DB or server routes yet, for now making everything sync (can introduce async once everything is cleaned up and brought over)

* Added db script to insert assets stuff, cleaned up some code; assets (models) now get added/rescanned

* Added support for 5 http endpoints for assets

* Replaced Optional with | None in schemas_in.py and schemas_out.py

* Remove two routes that will not be relevant yet in this PR: HEAD /api/assets/hash/<hash> and PUT /api/assets/<id>/preview

* Remove some functions the two deleted endpoints were using

* Don't show assets scan message upon calling /object_info endpoint

* removed unsued import to satisfy ruff

* Simplified hashing function tpye hint and _hash_file_obj

* Satisfied ruff
2026-01-08 22:21:51 -05:00
comfyanonymous
65cfcf5b1b
New Year ruff cleanup. (#11595) 2026-01-01 22:06:14 -05:00
Dr.Lt.Data
af96d9812d
feat(security): add System User protection with __ prefix (#10966)
* feat(security): add System User protection with `__` prefix

Add protected namespace for custom nodes to store sensitive data
(API keys, licenses) that cannot be accessed via HTTP endpoints.

Key changes:
- New API: get_system_user_directory() for internal access
- New API: get_public_user_directory() with structural blocking
- 3-layer defense: header validation, path blocking, creation prevention
- 54 tests covering security, edge cases, and backward compatibility

System Users use `__` prefix (e.g., __system, __cache) following
Python's private member convention. They exist in user_directory/
but are completely blocked from /userdata HTTP endpoints.

* style: remove unused imports
2025-11-28 21:28:42 -05:00
Dr.Lt.Data
ca7808f240
fix(user_manager): fix typo in move_userdata dest validation (#10967)
Check `dest` instead of `source` when validating destination path
in move_userdata endpoint.
2025-11-28 12:43:17 -08:00
Christian Byrne
87b0359392
Update server templates handler to use new multi-package distribution (comfyui-workflow-templates versions >=0.3) (#10791)
* update templates for monorepo

* refactor
2025-11-19 22:36:56 -08:00
Jedrzej Kosinski
f13cff0be6
Add custom node published subgraphs endpoint (#10438)
* Add get_subgraphs_dir to ComfyExtension and PUBLISHED_SUBGRAPH_DIRS to nodes.py

* Created initial endpoints, although the returned paths are a bit off currently

* Fix path and actually return real data

* Sanitize returned /api/global_subgraphs entries

* Remove leftover function from early prototyping

* Remove added whitespace

* Add None check for sanitize_entry
2025-10-21 23:16:16 -04:00
Christian Byrne
255572188f
Add workflow templates version tracking to system_stats (#9089)
Adds installed and required workflow templates version information to the
/system_stats endpoint, allowing the frontend to detect and notify users
when their templates package is outdated.

- Add get_installed_templates_version() and get_required_templates_version()
  methods to FrontendManager
- Include templates version info in system_stats response
- Add comprehensive unit tests for the new functionality
2025-09-26 21:29:13 -07:00
Christian Byrne
3e316c6338
Update frontend to v1.25.10 and revert navigation mode override (#9522)
- Update comfyui-frontend-package from 1.25.9 to 1.25.10
- Revert forced legacy navigation mode from PR #9518
- Frontend v1.25.10 includes proper navigation mode fixes and improved display text
2025-08-23 17:54:01 -04:00
comfyanonymous
8be0d22ab7
Don't use the annoying new navigation mode by default. (#9518) 2025-08-23 13:56:17 -04:00
saurabh-pingale
0737b7e0d2
fix(userdata): catch invalid workflow filenames (#9434) (#9445) 2025-08-20 22:27:57 -04:00
Johnpaul Chiwetelu
3dfefc88d0
API for Recently Used Items (#8792)
* feat: add file creation time to model file metadata and user file info

* fix linting
2025-08-01 22:02:06 -04:00
SHIVANSH GUPTA
d03ae077b4
Added parameter required_frontend_version in the /system_stats API response (#8875)
* Added the parameter required_frontend_version in the /system_stats  api response

* Update server.py

* Created a function get_required_frontend_version and wrote tests for it

* Refactored the function to return currently installed frontend pacakage version

* Moved required_frontend to a new function and imported that in server.py

* Corrected test cases using mocking techniques

* Corrected files to comply with ruff formatting
2025-07-24 14:05:54 -04:00
filtered
baa8c8cdd3
Add '@prerelease' to use latest test frontend (#8501)
* Add '@prerelease' to use latest test frontend

Allows download of pre-release versions.

Will always get the latest pre-release version - even if it's older than the latest stable release.

* nit
2025-06-12 17:03:27 -07:00
filtered
ecb8d15e7a
Allow specifying any frontend semver suffixes (#8498) 2025-06-11 21:41:30 -04:00
pythongosssss
50c605e957
Add support for sqlite database (#8444)
* Add support for sqlite database

* fix
2025-06-11 16:43:39 -04:00
Benjamin Lu
180db6753f
Add Help Menu in NodeLibrarySidebarTab (#8179) 2025-06-01 04:32:32 -04:00
comfyanonymous
d9c80a85e5
This should not be a warning. (#7946) 2025-05-05 07:49:07 -04:00