ComfyUI/app/assets
Matt Miller 54c92d0462 Add clear_preview_id flag + validation to UpdateAsset
Replaces #13744 with a narrower change. Decision after review: drop the
dedicated PUT/DELETE /api/assets/{id}/preview endpoints in favor of
extending the existing PUT /api/assets/{id} route with a clear_preview_id
flag, matching the codebase's existing pattern for clearing operations
elsewhere in the project (`clear: true` on /api/queue and /api/history in
the cloud sibling).

Changes:
- openapi.yaml: add `clear_preview_id: boolean` to the UpdateAsset request
  body, documented as taking precedence over `preview_id` when both are set.
- schemas_in.UpdateAssetBody: add the field, extend at-least-one-field
  validation (clear=true counts, clear=false is a no-op), reject the zero
  UUID as `preview_id`.
- services/asset_management.update_asset_metadata: add `clear_preview_id`
  param; when true, call set_reference_preview with None to clear the link.
  Clear takes precedence over set when both provided.
- routes.update_asset_route: wire the flag through. Reject self-referential
  preview_id (preview_id == path id) at 400 SELF_REFERENCE before service
  call.
- Tests: cover clear-via-flag happy path, clear-takes-precedence, schema
  validation edge cases (zero UUID rejected, clear-only valid, false-only
  rejected).
2026-05-20 13:56:26 -07:00
..
api Add clear_preview_id flag + validation to UpdateAsset 2026-05-20 13:56:26 -07:00
database feat(assets): register output files as assets after prompt execution (#12812) 2026-03-24 20:48:55 -07:00
services Add clear_preview_id flag + validation to UpdateAsset 2026-05-20 13:56:26 -07:00
helpers.py refactor(assets): modular architecture + async two-phase scanner & background seeder (#12621) 2026-03-07 20:37:25 -05:00
scanner.py feat(assets): register output files as assets after prompt execution (#12812) 2026-03-24 20:48:55 -07:00
seeder.py feat(assets): register output files as assets after prompt execution (#12812) 2026-03-24 20:48:55 -07:00