Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
coderai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
coderai
Commits
6eb3b9b8
Commit
6eb3b9b8
authored
Mar 19, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error handling for incomplete diffusers models
parent
17205499
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
images.py
codai/api/images.py
+8
-0
No files found.
codai/api/images.py
View file @
6eb3b9b8
...
@@ -296,6 +296,14 @@ async def create_image_generation(request: ImageGenerationRequest, http_request:
...
@@ -296,6 +296,14 @@ async def create_image_generation(request: ImageGenerationRequest, http_request:
print
(
f
"Warning: First model load attempt failed: {load_error}"
)
print
(
f
"Warning: First model load attempt failed: {load_error}"
)
print
(
"Trying alternative loading method..."
)
print
(
"Trying alternative loading method..."
)
# Check if it's a missing component error (incomplete model)
if
"expected"
in
str
(
load_error
)
and
"but only"
in
str
(
load_error
):
# This is an incomplete model - don't keep retrying the same thing
print
(
f
"Error: Model '{model_to_use}' is incomplete or missing required components (unet, image_encoder, etc.)"
)
print
(
"This model cannot be loaded with diffusers. Trying stable-diffusion-cpp-python instead..."
)
# Skip the retry attempts and go directly to sd.cpp
raise
Exception
(
f
"Incomplete model: {load_error}"
)
# Try with default resolution
# Try with default resolution
try
:
try
:
if
is_xl
:
if
is_xl
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment