Luke Mino-Altherr
aef0330555
Fix double commit in create_from_hash
...
Move mime_type update into _register_existing_asset so it shares a
single transaction with reference creation. Log a warning when the
hash is not found instead of silently returning None.
Amp-Thread-ID: https://ampcode.com/threads/T-019ce377-8bde-7048-bc28-a9df063409f9
Co-authored-by: Amp <amp@ampcode.com >
2026-03-12 17:39:08 -07:00
Luke Mino-Altherr
9f404be3c5
Make ReferenceData.created_at and updated_at required
...
Remove None defaults and type: ignore comments. Move fields before
optional fields to satisfy dataclass ordering.
Amp-Thread-ID: https://ampcode.com/threads/T-019ce377-8bde-7048-bc28-a9df063409f9
Co-authored-by: Amp <amp@ampcode.com >
2026-03-12 17:39:08 -07:00
Luke Mino-Altherr
6587a7394e
Add owner_id check to resolve_hash_to_path
...
Filter asset references by owner visibility so the /view endpoint
only resolves hashes for assets the requesting user can access.
Adds table-driven tests for owner visibility cases.
Amp-Thread-ID: https://ampcode.com/threads/T-019ce377-8bde-7048-bc28-a9df063409f9
Co-authored-by: Amp <amp@ampcode.com >
2026-03-12 17:39:08 -07:00
Luke Mino-Altherr
c563672043
Move blake3 hash resolution to asset_management service
...
Extract resolve_hash_to_path() into asset_management.py and remove
_resolve_blake3_to_path from server.py. Also revert loopback origin
check to original logic.
Amp-Thread-ID: https://ampcode.com/threads/T-019ce023-3384-7560-bacf-de40b0de0dd2
Co-authored-by: Amp <amp@ampcode.com >
2026-03-12 17:39:08 -07:00
Luke Mino-Altherr
0d5d4a3b8a
Register uploaded images in asset database when --enable-assets is set
...
Add register_file_in_place() service function to ingest module for
registering already-saved files without moving them. Call it from the
/upload/image endpoint to return asset metadata in the response.
Amp-Thread-ID: https://ampcode.com/threads/T-019ce023-3384-7560-bacf-de40b0de0dd2
Co-authored-by: Amp <amp@ampcode.com >
2026-03-12 17:39:08 -07:00
Luke Mino-Altherr
6f41a40543
feat(assets): align local API with cloud spec
...
Unify response models, add missing fields, and align input schemas with
the cloud OpenAPI spec at cloud.comfy.org/openapi.
- Replace AssetSummary/AssetDetail/AssetUpdated with single Asset model
- Add is_immutable, metadata (system_metadata), prompt_id fields
- Support mime_type and preview_id in update endpoint
- Make CreateFromHashBody.name optional, add mime_type, require >=1 tag
- Add id/mime_type/preview_id to upload, relax tags to optional
- Rename total_tags → tags in tag add/remove responses
- Add GET /api/assets/tags/refine histogram endpoint
- Add DB migration for system_metadata and prompt_id columns
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-12 17:39:08 -07:00
comfyanonymous
e4b0bb8305
Import assets seeder later, print some package versions. ( #12841 )
2026-03-08 16:25:30 -04:00
Luke Mino-Altherr
29b24cb517
refactor(assets): modular architecture + async two-phase scanner & background seeder ( #12621 )
2026-03-07 20:37:25 -05:00