mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
chore: flake8
This commit is contained in:
parent
f6bbcd0589
commit
045d3f6139
@ -350,17 +350,17 @@ class ModelInstall(object):
|
|||||||
for suffix in ["safetensors", "bin"]:
|
for suffix in ["safetensors", "bin"]:
|
||||||
if f"{prefix}pytorch_lora_weights.{suffix}" in files:
|
if f"{prefix}pytorch_lora_weights.{suffix}" in files:
|
||||||
location = self._download_hf_model(
|
location = self._download_hf_model(
|
||||||
repo_id, [f"pytorch_lora_weights.bin"], staging, subfolder=subfolder
|
repo_id, ["pytorch_lora_weights.bin"], staging, subfolder=subfolder
|
||||||
) # LoRA
|
) # LoRA
|
||||||
break
|
break
|
||||||
elif (
|
elif (
|
||||||
self.config.precision == "float16" and f"{prefix}diffusion_pytorch_model.fp16.{suffix}" in files
|
self.config.precision == "float16" and f"{prefix}diffusion_pytorch_model.fp16.{suffix}" in files
|
||||||
): # vae, controlnet or some other standalone
|
): # vae, controlnet or some other standalone
|
||||||
files = [f"config.json", f"diffusion_pytorch_model.fp16.{suffix}"]
|
files = ["config.json", f"diffusion_pytorch_model.fp16.{suffix}"]
|
||||||
location = self._download_hf_model(repo_id, files, staging, subfolder=subfolder)
|
location = self._download_hf_model(repo_id, files, staging, subfolder=subfolder)
|
||||||
break
|
break
|
||||||
elif f"{prefix}diffusion_pytorch_model.{suffix}" in files:
|
elif f"{prefix}diffusion_pytorch_model.{suffix}" in files:
|
||||||
files = [f"config.json", f"diffusion_pytorch_model.{suffix}"]
|
files = ["config.json", f"diffusion_pytorch_model.{suffix}"]
|
||||||
location = self._download_hf_model(repo_id, files, staging, subfolder=subfolder)
|
location = self._download_hf_model(repo_id, files, staging, subfolder=subfolder)
|
||||||
break
|
break
|
||||||
elif f"{prefix}learned_embeds.{suffix}" in files:
|
elif f"{prefix}learned_embeds.{suffix}" in files:
|
||||||
@ -371,13 +371,13 @@ class ModelInstall(object):
|
|||||||
elif (
|
elif (
|
||||||
f"{prefix}image_encoder.txt" in files and f"{prefix}ip_adapter.{suffix}" in files
|
f"{prefix}image_encoder.txt" in files and f"{prefix}ip_adapter.{suffix}" in files
|
||||||
): # IP-Adapter
|
): # IP-Adapter
|
||||||
files = [f"image_encoder.txt", f"ip_adapter.{suffix}"]
|
files = ["image_encoder.txt", f"ip_adapter.{suffix}"]
|
||||||
location = self._download_hf_model(repo_id, files, staging, subfolder=subfolder)
|
location = self._download_hf_model(repo_id, files, staging, subfolder=subfolder)
|
||||||
break
|
break
|
||||||
elif f"{prefix}model.{suffix}" in files and f"{prefix}config.json" in files:
|
elif f"{prefix}model.{suffix}" in files and f"{prefix}config.json" in files:
|
||||||
# This elif-condition is pretty fragile, but it is intended to handle CLIP Vision models hosted
|
# This elif-condition is pretty fragile, but it is intended to handle CLIP Vision models hosted
|
||||||
# by InvokeAI for use with IP-Adapters.
|
# by InvokeAI for use with IP-Adapters.
|
||||||
files = [f"config.json", f"model.{suffix}"]
|
files = ["config.json", f"model.{suffix}"]
|
||||||
location = self._download_hf_model(repo_id, files, staging, subfolder=subfolder)
|
location = self._download_hf_model(repo_id, files, staging, subfolder=subfolder)
|
||||||
break
|
break
|
||||||
if not location:
|
if not location:
|
||||||
|
Loading…
Reference in New Issue
Block a user