Yuanshi commited on
Commit
53015c9
·
verified ·
1 Parent(s): cdbe05f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -46,13 +46,13 @@ USE_ZERO_GPU = True
46
  # @spaces.GPU #[uncomment to use ZeroGPU]
47
  def infer(
48
  prompt,
 
49
  seed,
50
  randomize_seed,
51
  width,
52
  height,
53
  num_inference_steps,
54
  progress=gr.Progress(track_tqdm=True),
55
- model='2k',
56
  ):
57
  print("Using model:", model)
58
  if model == "2k":
@@ -83,7 +83,7 @@ def infer(
83
 
84
 
85
  if USE_ZERO_GPU:
86
- infer = spaces.GPU(infer)
87
 
88
  examples = [
89
  "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
@@ -124,14 +124,14 @@ with gr.Blocks(css=css) as demo:
124
 
125
  gr.Markdown("### Setting:")
126
 
127
- # model = gr.Radio(
128
- # label="Model",
129
- # choices=[
130
- # ("2K model", "2k"),
131
- # ("4K model (beta)", "4k"),
132
- # ],
133
- # value="2k",
134
- # )
135
 
136
  with gr.Row():
137
  width = gr.Slider(
@@ -176,7 +176,7 @@ with gr.Blocks(css=css) as demo:
176
  fn=infer,
177
  inputs=[
178
  prompt,
179
- # model,
180
  seed,
181
  randomize_seed,
182
  width,
 
46
  # @spaces.GPU #[uncomment to use ZeroGPU]
47
  def infer(
48
  prompt,
49
+ model,
50
  seed,
51
  randomize_seed,
52
  width,
53
  height,
54
  num_inference_steps,
55
  progress=gr.Progress(track_tqdm=True),
 
56
  ):
57
  print("Using model:", model)
58
  if model == "2k":
 
83
 
84
 
85
  if USE_ZERO_GPU:
86
+ infer = spaces.GPU(infer, duration=360)
87
 
88
  examples = [
89
  "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
 
124
 
125
  gr.Markdown("### Setting:")
126
 
127
+ model = gr.Radio(
128
+ label="Model",
129
+ choices=[
130
+ ("2K model", "2k"),
131
+ ("4K model (beta)", "4k"),
132
+ ],
133
+ value="2k",
134
+ )
135
 
136
  with gr.Row():
137
  width = gr.Slider(
 
176
  fn=infer,
177
  inputs=[
178
  prompt,
179
+ model,
180
  seed,
181
  randomize_seed,
182
  width,