diff --git a/invokeai/backend/model_manager/probe.py b/invokeai/backend/model_manager/probe.py index 77f2430454..f2f70f3038 100644 --- a/invokeai/backend/model_manager/probe.py +++ b/invokeai/backend/model_manager/probe.py @@ -132,7 +132,8 @@ class ModelProbe(object): format_type = ModelFormat.Diffusers if model_path.is_dir() else ModelFormat.Checkpoint model_info = None - model_type = ModelType(fields['type']) if 'type' in fields else None + model_type = fields['type'] if 'type' in fields else None + model_type = ModelType(model_type) if isinstance(model_type, str) else model_type if not model_type: if format_type is ModelFormat.Diffusers: model_type = cls.get_model_type_from_folder(model_path) @@ -157,7 +158,7 @@ class ModelProbe(object): fields["image_encoder_model_id"] = fields.get("image_encoder_model_id") or probe.get_image_encoder_model_id() fields["name"] = fields.get("name") or cls.get_model_name(model_path) fields["description"] = ( - fields.get("description") or f"{fields['base'].value} {fields['type'].value} model {fields['name']}" + fields.get("description") or f"{fields['base'].value} {model_type.value} model {fields['name']}" ) fields["format"] = fields.get("format") or probe.get_format() fields["hash"] = fields.get("hash") or ModelHash(algorithm=hash_algo).hash(model_path) diff --git a/tests/app/services/model_install/test_model_install.py b/tests/app/services/model_install/test_model_install.py index 85b765d739..b4265da9f7 100644 --- a/tests/app/services/model_install/test_model_install.py +++ b/tests/app/services/model_install/test_model_install.py @@ -9,6 +9,7 @@ from pathlib import Path import pytest from pydantic import ValidationError from pydantic.networks import Url +from time import sleep from invokeai.app.services.config import InvokeAIAppConfig from invokeai.app.services.events.events_base import EventServiceBase @@ -20,7 +21,7 @@ from invokeai.app.services.model_install import ( URLModelSource, ) from invokeai.app.services.model_records import UnknownModelException -from invokeai.backend.model_manager.config import BaseModelType, ModelFormat, ModelType +from invokeai.backend.model_manager.config import BaseModelType, ModelFormat, ModelType, InvalidModelConfigException from tests.backend.model_manager.model_manager_fixtures import * # noqa F403 OS = platform.uname().system @@ -53,7 +54,7 @@ def test_registration_meta(mm2_installer: ModelInstallServiceBase, embedding_fil def test_registration_meta_override_fail(mm2_installer: ModelInstallServiceBase, embedding_file: Path) -> None: key = None - with pytest.raises(ValidationError): + with pytest.raises((ValidationError, InvalidModelConfigException)): key = mm2_installer.register_path(embedding_file, {"name": "banana_sushi", "type": ModelType("lora")}) assert key is None @@ -263,3 +264,36 @@ def test_404_download(mm2_installer: ModelInstallServiceBase, mm2_app_config: In assert job.error assert "NOT FOUND" in job.error assert job.error_traceback.startswith("Traceback") + + +@pytest.mark.parametrize( + "model_params", + [ + # SDXL, Lora + { + "repo_id": "InvokeAI-test/textual_inversion_tests::learned_embeds-steps-1000.safetensors", + "name": "test_lora", + "type": 'embedding', + }, + # SDXL, Lora - incorrect type + { + "repo_id": "InvokeAI-test/textual_inversion_tests::learned_embeds-steps-1000.safetensors", + "name": "test_lora", + "type": 'lora', + }, + ], +) +def test_heuristic_import_with_type(mm2_installer: ModelInstallServiceBase, model_params: Dict[str, str]): + """Test whether or not type is respected on configs when passed to heuristic import.""" + config: Dict[str, Any] = { + "type": model_params["type"], + } + try: + assert("repo_id" in model_params) + install_job = mm2_installer.heuristic_import(source=model_params["repo_id"], config=config) + + while not install_job.in_terminal_state: + sleep(.01) + assert(install_job.config_out if model_params["type"] == "embedding" else not install_job.config_out) + except InvalidModelConfigException: + assert model_params["type"] != "embedding" diff --git a/tests/backend/model_manager/model_manager_fixtures.py b/tests/backend/model_manager/model_manager_fixtures.py index af66264f9c..afc11c1ac1 100644 --- a/tests/backend/model_manager/model_manager_fixtures.py +++ b/tests/backend/model_manager/model_manager_fixtures.py @@ -38,6 +38,7 @@ from tests.backend.model_manager.model_metadata.metadata_examples import ( RepoHFMetadata1, RepoHFMetadata1_nofp16, RepoHFModelJson1, + HFTestLoraMetadata, ) from tests.fixtures.sqlite_database import create_mock_sqlite_database @@ -300,6 +301,23 @@ def mm2_session(embedding_file: Path, diffusers_dir: Path) -> Session: headers={"Content-Type": "application/json; charset=utf-8", "Content-Length": len(RepoHFMetadata1)}, ), ) + + with open(embedding_file, "rb") as f: + data = f.read() # file is small - just 15K + sess.mount( + "https://huggingface.co/api/models/InvokeAI-test/textual_inversion_tests?blobs=True", + TestAdapter( + HFTestLoraMetadata, + headers={"Content-Type": "application/json; charset=utf-8", "Content-Length": len(HFTestLoraMetadata)}, + ), + ) + sess.mount( + "https://huggingface.co/InvokeAI-test/textual_inversion_tests/resolve/main/learned_embeds-steps-1000.safetensors", + TestAdapter( + data, + headers={"Content-Type": "application/json; charset=utf-8", "Content-Length": len(data)}, + ), + ) for root, _, files in os.walk(diffusers_dir): for name in files: path = Path(root, name) diff --git a/tests/backend/model_manager/model_metadata/metadata_examples.py b/tests/backend/model_manager/model_metadata/metadata_examples.py index ef1c1e446d..162520238f 100644 --- a/tests/backend/model_manager/model_metadata/metadata_examples.py +++ b/tests/backend/model_manager/model_metadata/metadata_examples.py @@ -25,3 +25,8 @@ RepoCivitaiVersionMetadata1 = b""" RepoCivitaiModelMetadata1 = b""" {"id":215485,"name":"SDXL Turbo-LoRA-Stable Diffusion XL faster than light","description":"

v1: 128 dim

v1-64dim: half dimension, similar quality

v1-16dim: 94MB, similar quality(but different results in some prompts... I suggest the 128 dim or 64 dim version, but if you have a gpu with 6 GB vram try this version)

LoRA based on sdxl turbo, you can use the TURBO with any stable diffusion xl checkpoint, few seconds = 1 image(3 seconds with a nvidia rtx 3060 12 GB with 1024x768 resolution)

Tested on webui 1111 v1.6.0-2-g4afaaf8a

Tested on ComfyUI v1754 [777f6b15]: workflow --download here--

(new version of workflow November 30, 2023 remove strange violet fog, keep sgm_uniform as scheduler and you can use every sampler)

1-Select your favourite stable diffusion xl checkpoint

2-Download this LoRA, use my workflow for ComfyUI or any workflow with LoRA loader

For webui 1111 write in the prompt <lora:sd_xl_turbo_lora_v1:1>

3-Sampling method on webui 1111: LCM(install animatediff extension if you don't see it in sampling list)

Sampling method on ComfyUI: all, with the workflow of November 30, 2023

4-CFG Scale: from 1 to 2.5

5-Sampling steps: 4

Hugginface page: https://huggingface.co/shiroppo/sd_xl_turbo_lora

---

Ko-fi: https://ko-fi.com/shiroppo

Patreon: https://www.patreon.com/Shiroppo

Pixiv: https://www.pixiv.net/users/7058273

Twitter: https://twitter.com/ShiroppoTwit

Instagram: https://www.instagram.com/shiroppo_real/

My pages: https://solo.to/shiroppo

---

","type":"LORA","poi":false,"nsfw":false,"allowNoCredit":false,"allowCommercialUse":["RentCivit"],"allowDerivatives":false,"allowDifferentLicense":true,"stats":{"downloadCount":4842,"favoriteCount":252,"commentCount":25,"ratingCount":4,"rating":5,"tippedAmountCount":2653},"creator":{"username":"test_author","image":"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/d0b4b9d4-f32c-441a-99e1-9b2d73679bd7/width=96/shiroppo.jpeg"},"tags":["tool","turbo","sdxl turbo"],"modelVersions":[{"id":242807,"modelId":215485,"name":"v1-128dim","createdAt":"2023-11-29T01:21:22.372Z","updatedAt":"2023-12-16T17:46:14.313Z","status":"Published","publishedAt":"2023-11-29T01:28:10.937Z","trainedWords":[],"trainingStatus":null,"trainingDetails":null,"baseModel":"SDXL Turbo","baseModelType":null,"earlyAccessTimeFrame":0,"description":"

v1: First version(128 dim)

","vaeId":null,"stats":{"downloadCount":2586,"ratingCount":2,"rating":5},"files":[{"id":187907,"sizeKB":768888.859375,"name":"sd_xl_turbo_lora_v1.safetensors","type":"Model","metadata":{"fp":null,"size":null,"format":"SafeTensor"},"pickleScanResult":"Success","pickleScanMessage":"No Pickle imports","virusScanResult":"Success","virusScanMessage":null,"scannedAt":"2023-11-29T01:30:55.512Z","hashes":{"AutoV1":"6DC5F47A","AutoV2":"A599C42A9F","SHA256":"A599C42A9F4F7494C7F410DBC0FD432CF0242720509E9D52FA41AAC7A88D1B69","CRC32":"BF967A66","BLAKE3":"930E9A5CA9D31D2A35CE5A719120813F09CA927C61B5867C35CB547F9A279F62","AutoV3":"813EA5FB1C67F3CBF1C4DFF5D392EE5E073A2C41DCF3AB36CF6CDD872C4E7690"},"downloadUrl":"https://civitai.com/api/download/models/242807","primary":true}],"images":[{"url":"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/bbf39031-15e6-4f2c-b531-c2b5108a1a9d/width=450/4080480.jpeg","nsfw":"None","width":768,"height":1024,"hash":"U9G9BnR,GI%N00kC4-s:5soz4TMx?wV@^*o#","type":"image","metadata":{"hash":"U9G9BnR,GI%N00kC4-s:5soz4TMx?wV@^*o#","size":1098842,"width":768,"height":1024},"meta":{"VAE":"sd_xl_base_1.0_fixvae_fp16.vae.safetensors","Size":"768x1024","seed":2494203713,"Model":"sd_xl_base_1.0","steps":4,"hashes":{"model":"31e35c80fc"},"prompt":"1 girl, snow","Version":"v1.6.0-2-g4afaaf8a","sampler":"LCM","VAE hash":"235745af8d","cfgScale":1.5,"clipSkip":2,"resources":[{"hash":"31e35c80fc","name":"sd_xl_base_1.0","type":"model"}],"Model hash":"31e35c80fc","negativePrompt":"blurry, blurry_image, Lowres, Low_resolution, Low_picture_quality, Low_picture_anime, extra_anatomy, extra_body, extra_navel, extra_face, extra_eyes, extra_chest, extra_nipples, extra_hips, extra_arms, extra_hands, extra_fingers, extra_legs, extra_feet, extra_toe, missing_anatomy, missing_body, missing_navel, missing_face, missing_eyes, missing_chest, missing_nipples, missing_hips, missing_arms, missing_hands, missing_fingers, missing_legs, missing_feet, missing_toe, sketch, sketching, (worst quality:2), (low quality:2), ((monochrome)), ((grayscale)), inpainting, HDR, bad_prompt_version2, jpeg artifacts, signature, watermark, text, error, missing fingers","\\"sd_xl_turbo_lora_v1-128dim":"813ea5fb1c67\\""}},{"url":"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/06a2e73e-594c-4a07-b4a2-495922153589/width=450/4081177.jpeg","nsfw":"None","width":2304,"height":1187,"hash":"UeIOY5V@j[ax?bj@ayj[.7ogj@kC_Nfkj[j]","type":"image","metadata":{"hash":"UeIOY5V@j[ax?bj@ayj[.7ogj@kC_Nfkj[j]","size":3214188,"width":2304,"height":1187},"meta":{"VAE":"sd_xl_base_1.0_fixvae_fp16.vae.safetensors","Size":"768x1024","seed":2494203713,"Model":"sd_xl_base_1.0","steps":4,"Script":"X/Y/Z plot","X Type":"Prompt S/R","hashes":{"model":"31e35c80fc"},"prompt":"1girl, wind","Version":"v1.6.0-2-g4afaaf8a","sampler":"LCM","VAE hash":"235745af8d","cfgScale":1.5,"resources":[{"hash":"31e35c80fc","name":"sd_xl_base_1.0","type":"model"}],"Model hash":"31e35c80fc","negativePrompt":"blurry, blurry_image, Lowres, Low_resolution, Low_picture_quality, Low_picture_anime, extra_anatomy, extra_body, extra_navel, extra_face, extra_eyes, extra_chest, extra_nipples, extra_hips, extra_arms, extra_hands, extra_fingers, extra_legs, extra_feet, extra_toe, missing_anatomy, missing_body, missing_navel, missing_face, missing_eyes, missing_chest, missing_nipples, missing_hips, missing_arms, missing_hands, missing_fingers, missing_legs, missing_feet, missing_toe, sketch, sketching, (worst quality:2), (low quality:2), ((monochrome)), ((grayscale)), inpainting, HDR, jpeg artifacts, signature, watermark, text, error, missing fingers","sd_xl_turbo_lora_v1-16dim":"1>\\"","sd_xl_turbo_lora_v1-64dim":"1>","sd_xl_turbo_lora_v1-128dim":"1>","\\"sd_xl_turbo_lora_v1-128dim":"813ea5fb1c67\\""}},{"url":"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/6ab69760-60bd-4247-817e-1da98e8089f8/width=450/4008748.jpeg","nsfw":"None","width":1536,"height":1187,"hash":"UbIX~%RnjFWA_2RjjZof?vWUozof~qbba#of","type":"image","metadata":{"hash":"UbIX~%RnjFWA_2RjjZof?vWUozof~qbba#of","size":1818611,"width":1536,"height":1187},"meta":{"VAE":"sd_xl_base_1.0_fixvae_fp16.vae.safetensors","Size":"768x1024","seed":2494203713,"Model":"sd_xl_base_1.0","steps":4,"Script":"X/Y/Z plot","X Type":"Prompt S/R","hashes":{"model":"31e35c80fc"},"prompt":"1 girl, wind","Version":"v1.6.0-2-g4afaaf8a","sampler":"LCM","VAE hash":"500ea30284","cfgScale":1.5,"clipSkip":2,"resources":[{"name":"sd_xl_turbo_lora_v1","type":"lora","weight":1},{"hash":"31e35c80fc","name":"sd_xl_base_1.0","type":"model"}],"Model hash":"31e35c80fc","negativePrompt":"blurry, blurry_image, Lowres, Low_resolution, Low_picture_quality, Low_picture_anime, extra_anatomy, extra_body, extra_navel, extra_face, extra_eyes, extra_chest, extra_nipples, extra_hips, extra_arms, extra_hands, extra_fingers, extra_legs, extra_feet, extra_toe, missing_anatomy, missing_body, missing_navel, missing_face, missing_eyes, missing_chest, missing_nipples, missing_hips, missing_arms, missing_hands, missing_fingers, missing_legs, missing_feet, missing_toe, sketch, sketching, (worst quality:2), (low quality:2), ((monochrome)), ((grayscale)), inpainting, HDR, bad_prompt_version2, jpeg artifacts, signature, watermark, text, error, missing fingers","sd_xl_turbo_lora_v1":"1>,\\"","\\"sd_xl_turbo_lora_v1":"813ea5fb1c67\\""}},{"url":"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/fb1cb844-d642-4154-bf0c-2bef3af6dc5c/width=450/4009285.jpeg","nsfw":"None","width":768,"height":1024,"hash":"UKHxgQIT9u-oMxV?-=s.emxvskE0%%s;NHS2","type":"image","metadata":{"hash":"UKHxgQIT9u-oMxV?-=s.emxvskE0%%s;NHS2","size":972827,"width":768,"height":1024},"meta":{"Size":"768x1024","seed":2494203713,"Model":"juggernautXL_version6Rundiffusion","steps":4,"hashes":{"model":"1fe6c7ec54"},"prompt":"1 girl, wind","Version":"v1.6.0-2-g4afaaf8a","sampler":"LCM","cfgScale":1.5,"clipSkip":2,"resources":[{"name":"sd_xl_turbo_lora_v1","type":"lora","weight":1},{"hash":"1fe6c7ec54","name":"juggernautXL_version6Rundiffusion","type":"model"}],"Model hash":"1fe6c7ec54","negativePrompt":"blurry, blurry_image, Lowres, Low_resolution, Low_picture_quality, Low_picture_anime, extra_anatomy, extra_body, extra_navel, extra_face, extra_eyes, extra_chest, extra_nipples, extra_hips, extra_arms, extra_hands, extra_fingers, extra_legs, extra_feet, extra_toe, missing_anatomy, missing_body, missing_navel, missing_face, missing_eyes, missing_chest, missing_nipples, missing_hips, missing_arms, missing_hands, missing_fingers, missing_legs, missing_feet, missing_toe, sketch, sketching, (worst quality:2), (low quality:2), ((monochrome)), ((grayscale)), inpainting, HDR, bad_prompt_version2, jpeg artifacts, signature, watermark, text, error, missing fingers","\\"sd_xl_turbo_lora_v1":"813ea5fb1c67\\""}},{"url":"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/6ba8c956-967f-4e7e-ab50-85d064206c6d/width=450/4024412.jpeg","nsfw":"None","width":768,"height":768,"hash":"U5Hn8c05kY-o^j0LE0V=1nIm^4Ip0r~4bMR-","type":"image","metadata":{"hash":"U5Hn8c05kY-o^j0LE0V=1nIm^4Ip0r~4bMR-","size":832579,"width":768,"height":768},"meta":null},{"url":"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/659dc67e-3246-468e-a75e-996e6fa5e87e/width=450/4024238.jpeg","nsfw":"None","width":512,"height":512,"hash":"U9G*N=0iTM56;L9sw@I:0[=[$j=w00XT5Z=^","type":"image","metadata":{"hash":"U9G*N=0iTM56;L9sw@I:0[=[$j=w00XT5Z=^","size":384630,"width":512,"height":512},"meta":null},{"url":"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/abc9110d-9e19-4cdc-b67d-46de66848bc4/width=450/4025914.jpeg","nsfw":"None","width":1024,"height":768,"hash":"UPGSGwbc00IU~qIV9Zozo~M{SO%L%gt7X9nh","type":"image","metadata":{"hash":"UPGSGwbc00IU~qIV9Zozo~M{SO%L%gt7X9nh","size":1165953,"width":1024,"height":768},"meta":{"VAE":"sdxl_vae.safetensors","Size":"1024x768","seed":149324391,"Model":"sdxlUnstableDiffusers_v4Grimorium","steps":4,"hashes":{"model":"565af52b8e"},"prompt":"bag, black_hair, blue_sky, building, car, city, cloud, cloudy_sky, day, ground_vehicle, hat, house, lamppost, long_hair, motor_vehicle, mountain, mountainous_horizon, multiple_girls, outdoors, palm_tree, plant, potted_plant, road, road_sign, scenery, sky, snow, standing, street, tree","Version":"v1.6.0-2-g4afaaf8a","sampler":"LCM","VAE hash":"235745af8d","cfgScale":1.5,"clipSkip":2,"resources":[{"name":"sd_xl_turbo_lora_v1","type":"lora","weight":1},{"hash":"565af52b8e","name":"sdxlUnstableDiffusers_v4Grimorium","type":"model"}],"Model hash":"565af52b8e","negativePrompt":"(worst quality, low quality:1.4)","\\"sd_xl_turbo_lora_v1":"813ea5fb1c67\\""}}],"downloadUrl":"https://civitai.com/api/download/models/242807"},{"id":243508,"modelId":215485,"name":"v1-64dim","createdAt":"2023-11-29T14:44:26.562Z","updatedAt":"2023-12-16T17:46:36.863Z","status":"Published","publishedAt":"2023-11-29T14:49:26.079Z","trainedWords":[],"trainingStatus":null,"trainingDetails":null,"baseModel":"SDXL 1.0","baseModelType":null,"earlyAccessTimeFrame":0,"description":"

v1-64dim: half dimension, similar quality

","vaeId":null,"stats":{"downloadCount":2046,"ratingCount":2,"rating":5},"files":[{"id":189448,"sizeKB":1.4140625,"name":"sdxl_turbo_lora_workflow_comfyui_v1.zip","type":"Training Data","metadata":{"fp":null,"size":null,"format":"Other"},"pickleScanResult":"Success","pickleScanMessage":"No Pickle imports","virusScanResult":"Success","virusScanMessage":null,"scannedAt":"2023-11-30T15:45:36.773Z","hashes":{"AutoV2":"52DE4E494B","SHA256":"52DE4E494B919073071B6BDCA5E6A6B58B28267F8508646A7CA0D29230991B1D","CRC32":"A8B62FA5","BLAKE3":"AFE94AE62DBFAFDBA9497BBCB8F4D9E08327E51277A460AA8017222BEF530249"},"downloadUrl":"https://civitai.com/api/download/models/243508?type=Training%20Data"},{"id":188487,"sizeKB":384606.671875,"name":"sd_xl_turbo_lora_v1-64dim.safetensors","type":"Model","metadata":{"fp":null,"size":null,"format":"SafeTensor"},"pickleScanResult":"Success","pickleScanMessage":"No Pickle imports","virusScanResult":"Success","virusScanMessage":null,"scannedAt":"2023-11-29T14:51:02.892Z","hashes":{"AutoV1":"F128131B","AutoV2":"FE223AFC1A","SHA256":"FE223AFC1A165834BDD9CF2D3BFC82374468DED5F3EA8B6AB8018F02F380C557","CRC32":"8303EE37","BLAKE3":"8E3616A9114A8180A904B3FFFABD90B19A57ED3E8CB71CBE232737C34C24EC90","AutoV3":"D60E731380E2C401791D30021EC63E17B12978FCC2DBC9097FB1B735B6BFEF9F"},"downloadUrl":"https://civitai.com/api/download/models/243508","primary":true}],"images":[{"url":"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/d883f87d-5267-472a-827e-f0c554f5e081/width=450/4080474.jpeg","nsfw":"None","width":768,"height":1024,"hash":"U9GIp7NKL3xu00xu4-xa5tR*8wMx?wV[^*S2","type":"image","metadata":{"hash":"U9GIp7NKL3xu00xu4-xa5tR*8wMx?wV[^*S2","size":1059564,"width":768,"height":1024},"meta":{"VAE":"sd_xl_base_1.0_fixvae_fp16.vae.safetensors","Size":"768x1024","seed":2494203713,"Model":"sd_xl_base_1.0","steps":4,"hashes":{"model":"31e35c80fc"},"prompt":"1 girl, snow","Version":"v1.6.0-2-g4afaaf8a","sampler":"LCM","VAE hash":"235745af8d","cfgScale":1.5,"clipSkip":2,"resources":[{"hash":"31e35c80fc","name":"sd_xl_base_1.0","type":"model"}],"Model hash":"31e35c80fc","negativePrompt":"blurry, blurry_image, Lowres, Low_resolution, Low_picture_quality, Low_picture_anime, extra_anatomy, extra_body, extra_navel, extra_face, extra_eyes, extra_chest, extra_nipples, extra_hips, extra_arms, extra_hands, extra_fingers, extra_legs, extra_feet, extra_toe, missing_anatomy, missing_body, missing_navel, missing_face, missing_eyes, missing_chest, missing_nipples, missing_hips, missing_arms, missing_hands, missing_fingers, missing_legs, missing_feet, missing_toe, sketch, sketching, (worst quality:2), (low quality:2), ((monochrome)), ((grayscale)), inpainting, HDR, bad_prompt_version2, jpeg artifacts, signature, watermark, text, error, missing fingers","\\"sd_xl_turbo_lora_v1-64dim":"d60e731380e2\\""}},{"url":"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/aa9f243d-b695-476d-a50a-b88a38ff8134/width=450/4081183.jpeg","nsfw":"None","width":2304,"height":1187,"hash":"UeIOY5V@j[ax?bj@ayj[.7ogj@kC_Nfkj[j]","type":"image","metadata":{"hash":"UeIOY5V@j[ax?bj@ayj[.7ogj@kC_Nfkj[j]","size":3214188,"width":2304,"height":1187},"meta":{"VAE":"sd_xl_base_1.0_fixvae_fp16.vae.safetensors","Size":"768x1024","seed":2494203713,"Model":"sd_xl_base_1.0","steps":4,"Script":"X/Y/Z plot","X Type":"Prompt S/R","hashes":{"model":"31e35c80fc"},"prompt":"1girl, wind","Version":"v1.6.0-2-g4afaaf8a","sampler":"LCM","VAE hash":"235745af8d","cfgScale":1.5,"resources":[{"hash":"31e35c80fc","name":"sd_xl_base_1.0","type":"model"}],"Model hash":"31e35c80fc","negativePrompt":"blurry, blurry_image, Lowres, Low_resolution, Low_picture_quality, Low_picture_anime, extra_anatomy, extra_body, extra_navel, extra_face, extra_eyes, extra_chest, extra_nipples, extra_hips, extra_arms, extra_hands, extra_fingers, extra_legs, extra_feet, extra_toe, missing_anatomy, missing_body, missing_navel, missing_face, missing_eyes, missing_chest, missing_nipples, missing_hips, missing_arms, missing_hands, missing_fingers, missing_legs, missing_feet, missing_toe, sketch, sketching, (worst quality:2), (low quality:2), ((monochrome)), ((grayscale)), inpainting, HDR, jpeg artifacts, signature, watermark, text, error, missing fingers","sd_xl_turbo_lora_v1-16dim":"1>\\"","sd_xl_turbo_lora_v1-64dim":"1>","sd_xl_turbo_lora_v1-128dim":"1>","\\"sd_xl_turbo_lora_v1-128dim":"813ea5fb1c67\\""}}],"downloadUrl":"https://civitai.com/api/download/models/243508"},{"id":245733,"modelId":215485,"name":"v1-16dim","createdAt":"2023-12-01T12:08:27.252Z","updatedAt":"2023-12-16T17:46:52.924Z","status":"Published","publishedAt":"2023-12-01T12:09:51.046Z","trainedWords":[],"trainingStatus":null,"trainingDetails":null,"baseModel":"SD 1.5","baseModelType":null,"earlyAccessTimeFrame":0,"description":"

94MB, similar quality(but different results in some prompts)

","vaeId":null,"stats":{"downloadCount":210,"ratingCount":0,"rating":0},"files":[{"id":190274,"sizeKB":96392.859375,"name":"sd_xl_turbo_lora_v1-16dim.safetensors","type":"Model","metadata":{"fp":null,"size":null,"format":"SafeTensor"},"pickleScanResult":"Success","pickleScanMessage":"No Pickle imports","virusScanResult":"Success","virusScanMessage":null,"scannedAt":"2023-12-01T13:00:52.623Z","hashes":{"AutoV1":"D079F12E","AutoV2":"65605FC5C3","SHA256":"65605FC5C31CFC3E35C90CEC1FCA493A74D438C357327636750591C79A0B6EB9","CRC32":"4AEBF056","BLAKE3":"6C83D51D57C21185D9AA8012D240999DD42CBF5FF1BA6C8BABB90C77FFEE8DF0","AutoV3":"9CBD5006993C2F4FF4BED107FED487900754A25816D34883FD2BA3185D7DF0BD"},"downloadUrl":"https://civitai.com/api/download/models/245733","primary":true}],"images":[{"url":"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/bc1f930d-e499-44ca-9d29-1bab91b568ff/width=450/4080469.jpeg","nsfw":"None","width":768,"height":1024,"hash":"UBHLlIX9u6aK00%M9Z%NE,M{DNIT.SoM%1Io","type":"image","metadata":{"hash":"UBHLlIX9u6aK00%M9Z%NE,M{DNIT.SoM%1Io","size":1045153,"width":768,"height":1024},"meta":{"VAE":"sd_xl_base_1.0_fixvae_fp16.vae.safetensors","Size":"768x1024","seed":2494203713,"Model":"sd_xl_base_1.0","steps":4,"hashes":{"model":"31e35c80fc"},"prompt":"1 girl, snow","Version":"v1.6.0-2-g4afaaf8a","sampler":"LCM","VAE hash":"235745af8d","cfgScale":1.5,"clipSkip":2,"resources":[{"hash":"31e35c80fc","name":"sd_xl_base_1.0","type":"model"}],"Model hash":"31e35c80fc","negativePrompt":"blurry, blurry_image, Lowres, Low_resolution, Low_picture_quality, Low_picture_anime, extra_anatomy, extra_body, extra_navel, extra_face, extra_eyes, extra_chest, extra_nipples, extra_hips, extra_arms, extra_hands, extra_fingers, extra_legs, extra_feet, extra_toe, missing_anatomy, missing_body, missing_navel, missing_face, missing_eyes, missing_chest, missing_nipples, missing_hips, missing_arms, missing_hands, missing_fingers, missing_legs, missing_feet, missing_toe, sketch, sketching, (worst quality:2), (low quality:2), ((monochrome)), ((grayscale)), inpainting, HDR, bad_prompt_version2, jpeg artifacts, signature, watermark, text, error, missing fingers","\\"sd_xl_turbo_lora_v1-16dim":"9cbd5006993c\\""}},{"url":"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/2f0149fc-43f6-40af-9aae-dc27956cf293/width=450/4081196.jpeg","nsfw":"None","width":2304,"height":1187,"hash":"UeIOY5V@j[ax?bj@ayj[.7ogj@kC_Nfkj[j]","type":"image","metadata":{"hash":"UeIOY5V@j[ax?bj@ayj[.7ogj@kC_Nfkj[j]","size":3214188,"width":2304,"height":1187},"meta":{"VAE":"sd_xl_base_1.0_fixvae_fp16.vae.safetensors","Size":"768x1024","seed":2494203713,"Model":"sd_xl_base_1.0","steps":4,"Script":"X/Y/Z plot","X Type":"Prompt S/R","hashes":{"model":"31e35c80fc"},"prompt":"1girl, wind","Version":"v1.6.0-2-g4afaaf8a","sampler":"LCM","VAE hash":"235745af8d","cfgScale":1.5,"resources":[{"hash":"31e35c80fc","name":"sd_xl_base_1.0","type":"model"}],"Model hash":"31e35c80fc","negativePrompt":"blurry, blurry_image, Lowres, Low_resolution, Low_picture_quality, Low_picture_anime, extra_anatomy, extra_body, extra_navel, extra_face, extra_eyes, extra_chest, extra_nipples, extra_hips, extra_arms, extra_hands, extra_fingers, extra_legs, extra_feet, extra_toe, missing_anatomy, missing_body, missing_navel, missing_face, missing_eyes, missing_chest, missing_nipples, missing_hips, missing_arms, missing_hands, missing_fingers, missing_legs, missing_feet, missing_toe, sketch, sketching, (worst quality:2), (low quality:2), ((monochrome)), ((grayscale)), inpainting, HDR, jpeg artifacts, signature, watermark, text, error, missing fingers","sd_xl_turbo_lora_v1-16dim":"1>\\"","sd_xl_turbo_lora_v1-64dim":"1>","sd_xl_turbo_lora_v1-128dim":"1>","\\"sd_xl_turbo_lora_v1-128dim":"813ea5fb1c67\\""}}],"downloadUrl":"https://civitai.com/api/download/models/245733"}]} """ + +# HF Metadata for testing heuristic import of a TI from HuggingFace +HFTestLoraMetadata = b""" +{"_id":"65bef127e4afda82b95e2f68","id":"InvokeAI-test/textual_inversion_tests","modelId":"InvokeAI-test/textual_inversion_tests","author":"InvokeAI-test","sha":"b4221947b01eb61658972c43e33250820d8e3411","lastModified":"2024-02-06T00:51:36.000Z","private":false,"disabled":false,"gated":false,"tags":["textual_inversion"],"downloads":2137,"library_name":"diffusers","likes":1,"cardData":{"license":"creativeml-openrail-m","base_model":"stabilityai/stable-diffusion-xl-base-1.0","tags":["stable-diffusion","stable-diffusion-diffusers","text-to-image","diffusers","textual_inversion"],"inference":true},"siblings":[{"rfilename":"learned_embeds-steps-1000.safetensors","blobId":"7759028f0b22f52eba74e0f50c8cd5d61ffb9c68","size":3184,"lfs":{"sha256":"f368050465cd473785298808c37abd17b98e5f532c144cc1be1f5e897092e67f","size":3184,"pointerSize":129}}],"createdAt":"2024-02-04T02:06:31.000Z"} +"""