anzorq commited on
Commit
9458c70
1 Parent(s): 029d60e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -2,6 +2,8 @@ from diffusers import StableDiffusionPipeline
2
  import gradio as gr
3
  import torch
4
 
 
 
5
  pipe = StableDiffusionPipeline.from_pretrained("nitrosocke/Arcane-Diffusion", torch_dtype=torch.float16)
6
  if torch.cuda.is_available():
7
  pipe = pipe.to("cuda")
@@ -14,7 +16,7 @@ def inference(prompt, guidance, steps):
14
 
15
  with gr.Blocks() as demo:
16
  with gr.Row():
17
- #gr.Markdown(f"Running on: {device}")
18
  with gr.Column():
19
  prompt = gr.Textbox(label="prompt")
20
  guidance = gr.Slider(label="guidance scale", value=7.5, maximum=15)
 
2
  import gradio as gr
3
  import torch
4
 
5
+ device = "cuda:0" if torch.cuda.is_available() else "cpu"
6
+
7
  pipe = StableDiffusionPipeline.from_pretrained("nitrosocke/Arcane-Diffusion", torch_dtype=torch.float16)
8
  if torch.cuda.is_available():
9
  pipe = pipe.to("cuda")
 
16
 
17
  with gr.Blocks() as demo:
18
  with gr.Row():
19
+ gr.Markdown(f"Running on: {device}")
20
  with gr.Column():
21
  prompt = gr.Textbox(label="prompt")
22
  guidance = gr.Slider(label="guidance scale", value=7.5, maximum=15)