Skip to content

Commit

Permalink
Fix resource paths, clarify flux ipa error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Sep 12, 2024
1 parent 09b6060 commit a0ed664
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 0 additions & 2 deletions ai_diffusion/cloud_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,6 @@ def _base64_size(size: int):
resource_id(ResourceKind.ip_adapter, Arch.sd15, ControlMode.face): None,
resource_id(ResourceKind.ip_adapter, Arch.sdxl, ControlMode.face): None,
resource_id(ResourceKind.clip_vision, Arch.all, "ip_adapter"): "clip-vision_vit-h.safetensors",
resource_id(ResourceKind.lora, Arch.sd15, "lcm"): "lcm-lora-sdv1-5.safetensors",
resource_id(ResourceKind.lora, Arch.sdxl, "lcm"): "lcm-lora-sdxl.safetensors",
resource_id(ResourceKind.lora, Arch.sd15, "hyper"): "Hyper-SD15-8steps-CFG-lora.safetensors",
resource_id(ResourceKind.lora, Arch.sdxl, "hyper"): "Hyper-SDXL-8steps-CFG-lora.safetensors",
resource_id(ResourceKind.lora, Arch.sd15, ControlMode.face): None,
Expand Down
10 changes: 7 additions & 3 deletions ai_diffusion/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,13 @@ def _update_is_supported(self):
if client := root.connection.client_if_connected:
models = client.models.for_checkpoint(self._model.style.sd_checkpoint)
if self.mode.is_ip_adapter and models.ip_adapter.find(self.mode) is None:
self.error_text = (
_("The server is missing the IP-Adapter model") + f" {self.mode.text}"
)
search_path = resources.search_path(ResourceKind.ip_adapter, models.arch, self.mode)
if search_path:
self.error_text = (
_("The server is missing the IP-Adapter model") + f" {self.mode.text}"
)
else:
self.error_text = _("Not supported for") + f" {models.arch.value}"
if not client.supports_ip_adapter:
self.error_text = _("IP-Adapter is not supported by this GPU")
is_supported = False
Expand Down
4 changes: 2 additions & 2 deletions ai_diffusion/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def __hash__(self):
ResourceId(ResourceKind.controlnet, Arch.flux, ControlMode.line_art),
{
Path(
"mistoline_flux.dev_v1.safetensors"
"models/controlnet/mistoline_flux.dev_v1.safetensors"
): "https://huggingface.co/TheMistoAI/MistoLine_Flux.dev/resolve/main/mistoline_flux.dev_v1.safetensors"
},
),
Expand All @@ -662,7 +662,7 @@ def __hash__(self):
ResourceId(ResourceKind.controlnet, Arch.flux, ControlMode.depth),
{
Path(
"flux-depth-controlnet-v3.safetensors"
"models/controlnet/flux-depth-controlnet-v3.safetensors"
): "https://huggingface.co/XLabs-AI/flux-controlnet-collections/resolve/main/flux-depth-controlnet-v3.safetensors"
},
),
Expand Down

0 comments on commit a0ed664

Please sign in to comment.