anzorq commited on
Commit
560783d
β€’
1 Parent(s): 6130ee7

Update template/app.py

Browse files
Files changed (1) hide show
  1. template/app.py +5 -6
template/app.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  import torch
4
  from PIL import Image
5
 
6
- model_name = '$model_name'
7
  prefix = '$prefix'
8
 
9
  scheduler = DPMSolverMultistepScheduler(
@@ -20,12 +20,12 @@ scheduler = DPMSolverMultistepScheduler(
20
  )
21
 
22
  pipe = StableDiffusionPipeline.from_pretrained(
23
- model_name,
24
  torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
25
  scheduler=scheduler)
26
 
27
  pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
28
- model_name,
29
  torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
30
  scheduler=scheduler)
31
 
@@ -94,11 +94,10 @@ with gr.Blocks(css=css) as demo:
94
  f"""
95
  <div class="main-div">
96
  <div>
97
- <h1>$model_name</h1>
98
  </div>
99
  <p>
100
- Demo for the <a href="https://huggingface.co/$model_name">$model_name</a> Stable Diffusion model.<br>
101
- Add the following tokens to your prompts for the effect: <b>$prefix</b>.
102
  </p>
103
  Running on <b>{"GPU πŸ”₯" if torch.cuda.is_available() else "CPU πŸ₯Ά"}</b>
104
  </div>
 
3
  import torch
4
  from PIL import Image
5
 
6
+ model_id = '$model_id'
7
  prefix = '$prefix'
8
 
9
  scheduler = DPMSolverMultistepScheduler(
 
20
  )
21
 
22
  pipe = StableDiffusionPipeline.from_pretrained(
23
+ model_id,
24
  torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
25
  scheduler=scheduler)
26
 
27
  pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
28
+ model_id,
29
  torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
30
  scheduler=scheduler)
31
 
 
94
  f"""
95
  <div class="main-div">
96
  <div>
97
+ <h1>$title</h1>
98
  </div>
99
  <p>
100
+ $description
 
101
  </p>
102
  Running on <b>{"GPU πŸ”₯" if torch.cuda.is_available() else "CPU πŸ₯Ά"}</b>
103
  </div>