mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
feat(civitai): list every file of a version in the gradio model details
The versions table showed only files[0], so precision variants of one version could not be downloaded. Each file gets its own row under rowspan version cells, sorted by precision then size, with a variant column and a star on the primary; rows download by fileId URL and All variants queues each version's primary from the fetched model. Companion files pass their own type, and save names carry the precision, then full/pruned and the file id only when needed to stay unique.
This commit is contained in:
@@ -71,6 +71,8 @@ def file_to_legacy_dict(f) -> dict:
|
||||
'size': int(f.size_kb * 1024),
|
||||
'name': f.name,
|
||||
'type': f.type,
|
||||
'primary': bool(f.primary),
|
||||
'metadata': {'fp': f.metadata.fp, 'format': f.metadata.format, 'size': f.metadata.size, 'quantType': f.metadata.quant_type},
|
||||
'hashes': [h for h in [f.hashes.sha256, f.hashes.autov1, f.hashes.autov2, f.hashes.autov3, f.hashes.crc32, f.hashes.blake3] if h],
|
||||
'url': f.download_url,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user