Commit f5b9d812 authored by Your Name's avatar Your Name

Fix: Skip sd.cpp fallback for non-GGUF models

- Added check to only attempt sd.cpp fallback for GGUF models
- Tongyi-MAI/Z-Image-Turbo is a diffusers model, not GGUF, so sd.cpp should be skipped
- sd.cpp only supports GGUF models, diffusers models use the diffusers pipeline
- This prevents unnecessary sd.cpp resolution attempts for incompatible model types
parent 392895da
......@@ -534,7 +534,17 @@ async def create_image_generation(request: ImageGenerationRequest, http_request:
print(f"Traceback: {traceback.format_exc()}")
print(f"Trying stable-diffusion-cpp-python...")
# Try stable-diffusion-cpp-python (sd.cpp) as fallback
# Try stable-diffusion-cpp-python (sd.cpp) as fallback - ONLY for GGUF models
# sd.cpp only works with GGUF models, not diffusers models
is_potential_gguf_model = (model_to_use.endswith('.gguf') or 'gguf' in model_to_use.lower() or
(model_to_use.startswith('http') and '.gguf' in model_to_use) or
(not model_to_use.startswith('http') and '/' in model_to_use)) # HF model IDs might be GGUF
if not is_potential_gguf_model:
print(f"Model '{model_to_use}' is not a GGUF model (sd.cpp only supports GGUF), skipping sd.cpp fallback")
sd_model = None
else:
# Try stable-diffusion-cpp-python (sd.cpp) as fallback for GGUF models
# First, check all available image models to find one loaded via sd.cpp
# Always check for cached models - allows dynamically loaded models to be reused across requests
sd_model = 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