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
963aa5d5
Commit
963aa5d5
authored
Mar 10, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Add diffusers fallback when GGUF image model fails to load"
This reverts commit
596d1245
.
parent
596d1245
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
68 deletions
+2
-68
coderai
coderai
+2
-68
No files found.
coderai
View file @
963aa5d5
...
...
@@ -4594,40 +4594,7 @@ def main():
print
(
f
"GGUF image model loaded successfully: {original_model_name}"
)
except
Exception
as
llama_error
:
print
(
f
"llama.cpp load error: {llama_error}"
)
print
(
f
"GGUF loading failed, trying diffusers fallback..."
)
try
:
import
torch
from
diffusers
import
StableDiffusionXLPipeline
,
DiffusionPipeline
print
(
f
"Loading diffusers pipeline: {model_name}"
)
try
:
pipeline
=
StableDiffusionXLPipeline
.
from_pretrained
(
model_name
,
torch_dtype
=
torch
.
float16
if
torch
.
cuda
.
is_available
()
else
torch
.
float32
,
use_safetensors
=
True
,
)
except
Exception
as
e
:
print
(
f
"SDXL failed, trying generic pipeline: {e}"
)
pipeline
=
DiffusionPipeline
.
from_pretrained
(
model_name
,
torch_dtype
=
torch
.
float16
if
torch
.
cuda
.
is_available
()
else
torch
.
float32
,
use_safetensors
=
True
,
)
if
torch
.
cuda
.
is_available
():
pipeline
=
pipeline
.
to
(
"cuda"
)
pipeline
.
enable_attention_slicing
()
else
:
pipeline
=
pipeline
.
to
(
"cpu"
)
multi_model_manager
.
add_model
(
model_key
,
pipeline
)
print
(
f
"Image model loaded successfully via diffusers: {model_name}"
)
except
ImportError
as
diffusers_err
:
print
(
f
"Warning: diffusers not installed: {diffusers_err}"
)
print
(
f
"Image model will load on first request"
)
except
Exception
as
diffusers_err
:
print
(
f
"Warning: diffusers fallback also failed: {diffusers_err}"
)
print
(
f
"Image model will load on first request"
)
print
(
f
"Will try loading image model on first request instead"
)
else
:
print
(
f
"Could not load GGUF image model: no valid model path"
)
...
...
@@ -5025,40 +4992,7 @@ def main():
print(f"GGUF image model loaded successfully: {original_model_name}")
except Exception as llama_error:
print(f"llama.cpp load error: {llama_error}")
print(f"GGUF loading failed, trying diffusers fallback...")
try:
import torch
from diffusers import StableDiffusionXLPipeline, DiffusionPipeline
print(f"Loading diffusers pipeline: {model_name}")
try:
pipeline = StableDiffusionXLPipeline.from_pretrained(
model_name,
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
use_safetensors=True,
)
except Exception as e:
print(f"SDXL failed, trying generic pipeline: {e}")
pipeline = DiffusionPipeline.from_pretrained(
model_name,
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
use_safetensors=True,
)
if torch.cuda.is_available():
pipeline = pipeline.to("cuda")
pipeline.enable_attention_slicing()
else:
pipeline = pipeline.to("cpu")
multi_model_manager.add_model(model_key, pipeline)
print(f"Image model loaded successfully via diffusers: {model_name}")
except ImportError as diffusers_err:
print(f"Warning: diffusers not installed: {diffusers_err}")
print(f"Image model will load on first request")
except Exception as diffusers_err:
print(f"Warning: diffusers fallback also failed: {diffusers_err}")
print(f"Image model will load on first request")
print(f"Will try loading image model on first request instead")
else:
print(f"Could not load GGUF image model: no valid model path")
...
...
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