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
5a1b67fe
Commit
5a1b67fe
authored
Mar 15, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert import name - package imports as stable_diffusion_cpp
parent
273264bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
coderai
coderai
+5
-5
No files found.
coderai
View file @
5a1b67fe
...
@@ -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
...
...
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