Commit f2d4e4c2 authored by Your Name's avatar Your Name

Fix model_key to use cached path instead of URL

parent 95fc9855
...@@ -4718,6 +4718,8 @@ def main(): ...@@ -4718,6 +4718,8 @@ def main():
try: try:
from stable_diffusion_cpp import StableDiffusion from stable_diffusion_cpp import StableDiffusion
# Define model_key for this scope
model_key = f"image:{model_path}"
print(f"Loading with sd.cpp: {model_path}") print(f"Loading with sd.cpp: {model_path}")
# For models like Z-Image-Turbo/Flux, use diffusion_model_path # For models like Z-Image-Turbo/Flux, use diffusion_model_path
# Look for additional model files in same directory # Look for additional model files in same directory
...@@ -4824,8 +4826,10 @@ def main(): ...@@ -4824,8 +4826,10 @@ def main():
import torch import torch
from diffusers import StableDiffusionXLPipeline, DiffusionPipeline from diffusers import StableDiffusionXLPipeline, DiffusionPipeline
model_key = f"image:{model_name}" # Use cached path if available
print(f"Loading diffusers pipeline: {model_name}") key_model = model_path if model_path and os.path.isfile(model_path) else model_name
model_key = f"image:{key_model}"
print(f"Loading diffusers pipeline: {key_model}")
# Try to load as Stable Diffusion XL first # Try to load as Stable Diffusion XL first
try: try:
...@@ -5409,8 +5413,10 @@ def main(): ...@@ -5409,8 +5413,10 @@ def main():
import torch import torch
from diffusers import StableDiffusionXLPipeline, DiffusionPipeline from diffusers import StableDiffusionXLPipeline, DiffusionPipeline
model_key = f"image:{model_name}" # Use cached path if available
print(f"Loading diffusers pipeline: {model_name}") key_model = model_path if model_path and os.path.isfile(model_path) else model_name
model_key = f"image:{key_model}"
print(f"Loading diffusers pipeline: {key_model}")
# Try to load as Stable Diffusion XL first # Try to load as Stable Diffusion XL first
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment