Commit 5a1b67fe authored by Your Name's avatar Your Name

Revert import name - package imports as stable_diffusion_cpp

parent 273264bf
...@@ -3478,7 +3478,7 @@ async def create_image_generation(request: ImageGenerationRequest): ...@@ -3478,7 +3478,7 @@ async def create_image_generation(request: ImageGenerationRequest):
if potential_model is not None: if potential_model is not None:
# Check if it's a stable-diffusion-cpp model # Check if it's a stable-diffusion-cpp model
try: try:
from stable_diffusion_cpp_python import StableDiffusion from stable_diffusion_cpp import StableDiffusion
if isinstance(potential_model, StableDiffusion): if isinstance(potential_model, StableDiffusion):
sd_model = potential_model sd_model = potential_model
print(f"Found stable-diffusion-cpp model with key: {key}") print(f"Found stable-diffusion-cpp model with key: {key}")
...@@ -3491,7 +3491,7 @@ async def create_image_generation(request: ImageGenerationRequest): ...@@ -3491,7 +3491,7 @@ async def create_image_generation(request: ImageGenerationRequest):
if sd_model is not None: if sd_model is not None:
# Check if it's a stable-diffusion-cpp model (has generate method from sd.cpp) # Check if it's a stable-diffusion-cpp model (has generate method from sd.cpp)
try: try:
from stable_diffusion_cpp_python import StableDiffusion from stable_diffusion_cpp import StableDiffusion
if isinstance(sd_model, StableDiffusion): if isinstance(sd_model, StableDiffusion):
print(f"Using stable-diffusion-cpp-python for image generation") print(f"Using stable-diffusion-cpp-python for image generation")
# Use sd.cpp for generation # Use sd.cpp for generation
...@@ -3555,7 +3555,7 @@ async def create_image_generation(request: ImageGenerationRequest): ...@@ -3555,7 +3555,7 @@ async def create_image_generation(request: ImageGenerationRequest):
# No sd.cpp model pre-loaded, try to load dynamically # No sd.cpp model pre-loaded, try to load dynamically
print("No pre-loaded sd.cpp model found, trying to load...") print("No pre-loaded sd.cpp model found, trying to load...")
try: try:
from stable_diffusion_cpp_python import StableDiffusion from stable_diffusion_cpp import StableDiffusion
# Check if model_to_use is a URL and get cached path # Check if model_to_use is a URL and get cached path
model_path = None model_path = None
...@@ -5144,7 +5144,7 @@ def main(): ...@@ -5144,7 +5144,7 @@ def main():
print(f"Trying stable-diffusion-cpp-python fallback...") print(f"Trying stable-diffusion-cpp-python fallback...")
# Try stable-diffusion-cpp-python as fallback # Try stable-diffusion-cpp-python as fallback
try: try:
from stable_diffusion_cpp_python import StableDiffusion from stable_diffusion_cpp import StableDiffusion
# Initialize model_key to None first so Python knows it exists # Initialize model_key to None first so Python knows it exists
model_key = None model_key = None
...@@ -5690,7 +5690,7 @@ def main(): ...@@ -5690,7 +5690,7 @@ def main():
print(f"Trying stable-diffusion-cpp-python fallback...") print(f"Trying stable-diffusion-cpp-python fallback...")
# Try stable-diffusion-cpp-python as fallback # Try stable-diffusion-cpp-python as fallback
try: try:
from stable_diffusion_cpp_python import StableDiffusion from stable_diffusion_cpp import StableDiffusion
# Initialize model_key to avoid unbound variable error # Initialize model_key to avoid unbound variable error
model_key = None model_key = None
......
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