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
f4034d4c
Commit
f4034d4c
authored
Mar 14, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: set GGML_VULKAN_DEVICE before importing stable_diffusion_cpp
parent
0f102700
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
coderai
coderai
+8
-10
No files found.
coderai
View file @
f4034d4c
...
...
@@ -4755,6 +4755,10 @@ def main():
print
(
f
"llama.cpp load error: {llama_error}"
)
print
(
f
"Trying stable-diffusion-cpp-python fallback..."
)
#
Try
stable
-
diffusion
-
cpp
-
python
as
fallback
#
Set
Vulkan
device
BEFORE
importing
stable_diffusion_cpp
if
args
.
image_vulkan_device
is
not
None
:
os
.
environ
[
'GGML_VULKAN_DEVICE'
]
=
str
(
args
.
image_vulkan_device
)
print
(
f
"Setting GGML_VULKAN_DEVICE={args.image_vulkan_device} for image model"
)
try
:
from
stable_diffusion_cpp
import
StableDiffusion
...
...
@@ -4819,11 +4823,6 @@ def main():
#
Build
kwargs
based
on
available
files
sd_kwargs
=
{
'diffusion_model_path'
:
model_path
}
#
Set
Vulkan
device
for
image
models
via
GGML_VULKAN_DEVICE
environment
variable
if
args
.
image_vulkan_device
is
not
None
:
os
.
environ
[
'GGML_VULKAN_DEVICE'
]
=
str
(
args
.
image_vulkan_device
)
print
(
f
"Setting GGML_VULKAN_DEVICE={args.image_vulkan_device} for image model"
)
if
clip_l_path
:
sd_kwargs
[
'llm_path'
]
=
clip_l_path
print
(
f
"DEBUG: Adding llm_path to sd_kwargs: {clip_l_path}"
)
...
...
@@ -5261,6 +5260,10 @@ def main():
print(f"llama.cpp load error: {llama_error}")
print(f"Trying stable-diffusion-cpp-python fallback...")
# Try stable-diffusion-cpp-python as fallback
# Set Vulkan device BEFORE importing stable_diffusion_cpp
if args.image_vulkan_device is not None:
os.environ['
GGML_VULKAN_DEVICE
'] = str(args.image_vulkan_device)
print(f"Setting GGML_VULKAN_DEVICE={args.image_vulkan_device} for image model")
try:
from stable_diffusion_cpp import StableDiffusion
...
...
@@ -5325,11 +5328,6 @@ def main():
# Build kwargs based on available files
sd_kwargs = {'
diffusion_model_path
': model_path}
# Set Vulkan device for image models via GGML_VULKAN_DEVICE environment variable
if args.image_vulkan_device is not None:
os.environ['
GGML_VULKAN_DEVICE
'] = str(args.image_vulkan_device)
print(f"Setting GGML_VULKAN_DEVICE={args.image_vulkan_device} for image model")
if clip_l_path:
sd_kwargs['
llm_path
'] = clip_l_path
print(f"DEBUG: Adding llm_path to sd_kwargs: {clip_l_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