-
Notifications
You must be signed in to change notification settings - Fork 11k
[Assets] Initial implementation #9545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Assets] Initial implementation #9545
Conversation
…ts for input validation
| except ValidationError as ve: | ||
| return _validation_error_response("INVALID_QUERY", ve) | ||
|
|
||
| payload = await assets_manager.list_assets( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When multi-user support is enabled (via the --multi-user flag), we would want to filter assets to only show:
- Those with no owner (i.e. things we just picked up off disk)
- Those where the current user is the owner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added in last commit. behavior:
Assets with no owner(assets_info.owner_id==``) are available for everyone for read, delete, edit.
Assets with the owner are available only for owner, but other users can create from the hash their own records in the assets_info using Create Asset from Hash endpoint.
efd2780 to
1faf722
Compare
1faf722 to
6fade5d
Compare
841983d to
7becb84
Compare
…ry instead of N+1
…ate endpoint for test suite.
arjansingh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for my needs. I do have some questions about the long term use of tags. See my inline comment for that.
| sa.Column("name", sa.String(length=512), nullable=False), | ||
| sa.Column("asset_id", sa.String(length=36), sa.ForeignKey("assets.id", ondelete="RESTRICT"), nullable=False), | ||
| sa.Column("preview_id", sa.String(length=36), sa.ForeignKey("assets.id", ondelete="SET NULL"), nullable=True), | ||
| sa.Column("user_metadata", sa.JSON(), nullable=True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So playing around locally:
Lora Model Asset
{
"id": "9afecf35-9af9-46b9-a68e-2aff1714115d",
"name": "blindbox_v1_mix.safetensors",
"asset_hash": "blake3:78195c5cff4c6d83a61b0d6b836d59f85efee66fbb953758e4b2af0389f8a802",
"size": 151108831,
"mime_type": null,
"tags": [
"loras",
"models"
],
"user_metadata": {
"filename": "blindbox_v1_mix.safetensors"
},
"preview_id": null,
"created_at": "2025-09-16T06:02:41.494068",
"last_access_time": "2025-09-16T06:02:41.494068"
}Checkpoint Model Asset
{
"id": "837a544e-bf0f-427d-b586-2da83ae0c353",
"name": "v1-5-pruned-emaonly-fp16.safetensors",
"asset_hash": "blake3:4c50ebc6e2a5cb19e8d19626d5ede1fb64755562085ce7383d86c72d1d03eb7e",
"size": 2132696762,
"mime_type": null,
"tags": [
"checkpoints",
"models"
],
"user_metadata": {
"filename": "v1-5-pruned-emaonly-fp16.safetensors"
},
"preview_id": null,
"created_at": "2025-09-16T06:02:41.456527",
"last_access_time": "2025-09-16T06:02:41.456527"
}@bigcat88 or @guill, confirm you that user_metadata.filename is the path we're going to be what we will be using for backwards compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also for our purposes, I am having to include frontend logic to parse and categorize the different types of models.
For Example:
- Fetch assets with tag "model"
- For each asset, categorize them by other tags (e.g., checkpoints, loras).
- Filter categorizes for ones I care about.
Is this intended? I could see it being fragile if we hardcode are changed or get removed. I guess the search endpoint in the future will fix this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6098227 to
621faaa
Compare
dda1442 to
85ef084
Compare
63ccbe5 to
283cd27
Compare
|
Since this is in a very good spot, I'll just go ahead and merge it into asset-management for easier iteration going forwards. |

This PR targets dev branch