FIX: CUDA detection when no CUDA
+VersionUP (0.5.0 alpha5)
This commit is contained in:
parent
d57dc191d6
commit
0fee58d4bf
@ -2,7 +2,7 @@
|
||||
|
||||
<img src="https://github.com/Gourieff/Assets/raw/main/sd-webui-reactor/ReActor_logo_red.png?raw=true" alt="logo" width="180px"/>
|
||||
|
||||

|
||||

|
||||
|
||||
<a href='https://ko-fi.com/gourieff' target='_blank'><img height='33' src='https://storage.ko-fi.com/cdn/kofi3.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
<img src="https://github.com/Gourieff/Assets/raw/main/sd-webui-reactor/ReActor_logo_red.png?raw=true" alt="logo" width="180px"/>
|
||||
|
||||

|
||||

|
||||
|
||||
<a href='https://ko-fi.com/gourieff' target='_blank'><img height='33' src='https://storage.ko-fi.com/cdn/kofi3.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
|
||||
|
||||
|
||||
@ -97,9 +97,9 @@ except:
|
||||
|
||||
with open(req_file) as file:
|
||||
install_count = 0
|
||||
ort = "onnxruntime-gpu"
|
||||
import torch
|
||||
try:
|
||||
ort = "onnxruntime-gpu"
|
||||
import torch
|
||||
if torch.cuda.is_available():
|
||||
if first_run:
|
||||
last_device = "CUDA"
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
import os, glob
|
||||
import gradio as gr
|
||||
from PIL import Image
|
||||
import torch.cuda as cuda
|
||||
try:
|
||||
import torch.cuda as cuda
|
||||
except:
|
||||
cuda = None
|
||||
|
||||
from typing import List
|
||||
|
||||
@ -136,24 +139,27 @@ class FaceSwapScript(scripts.Script):
|
||||
)
|
||||
with gr.Tab("Settings"):
|
||||
models = get_models()
|
||||
if cuda.is_available():
|
||||
with gr.Row():
|
||||
device = gr.Radio(
|
||||
label="Execution Provider",
|
||||
choices=DEVICE_LIST,
|
||||
value=DEVICE,
|
||||
type="value",
|
||||
info="If you already run 'Generate' - RESTART is required to apply. Click 'Save', (A1111) Extensions Tab -> 'Apply and restart UI' or (SD.Next) close the Server and start it again",
|
||||
scale=2,
|
||||
if cuda is not None:
|
||||
if cuda.is_available():
|
||||
with gr.Row():
|
||||
device = gr.Radio(
|
||||
label="Execution Provider",
|
||||
choices=DEVICE_LIST,
|
||||
value=DEVICE,
|
||||
type="value",
|
||||
info="If you already run 'Generate' - RESTART is required to apply. Click 'Save', (A1111) Extensions Tab -> 'Apply and restart UI' or (SD.Next) close the Server and start it again",
|
||||
scale=2,
|
||||
)
|
||||
save_device_btn = gr.Button("Save", scale=0)
|
||||
save = gr.Markdown("")
|
||||
setattr(device, "do_not_save_to_config", True)
|
||||
save_device_btn.click(
|
||||
set_Device,
|
||||
inputs=[device],
|
||||
outputs=[save],
|
||||
)
|
||||
save_device_btn = gr.Button("Save", scale=0)
|
||||
save = gr.Markdown("")
|
||||
setattr(device, "do_not_save_to_config", True)
|
||||
save_device_btn.click(
|
||||
set_Device,
|
||||
inputs=[device],
|
||||
outputs=[save],
|
||||
)
|
||||
else:
|
||||
device = "CPU"
|
||||
else:
|
||||
device = "CPU"
|
||||
with gr.Row():
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
app_title = "ReActor"
|
||||
version_flag = "v0.5.0-a4"
|
||||
version_flag = "v0.5.0-a5"
|
||||
|
||||
from scripts.reactor_logger import logger, get_Run, set_Run
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user