K00B404 commited on
Commit
358cdda
·
verified ·
1 Parent(s): aa6d53b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -18,13 +18,13 @@ css = """
18
  max-width: 512px;
19
  }
20
  """
21
-
22
  if torch.cuda.is_available():
23
  power_device = "GPU"
24
  device = "cuda"
25
- else:
26
- power_device = "CPU"
27
- device = "cpu"
28
 
29
 
30
  huggingface_token = os.getenv("HUGGINFACE_TOKEN")
@@ -48,7 +48,7 @@ pipe = FluxControlNetPipeline.from_pretrained(
48
  pipe.to(device)
49
 
50
  MAX_SEED = 1000000
51
- MAX_PIXEL_BUDGET = 1024 * 1024
52
 
53
 
54
  def process_input(input_image, upscale_factor, **kwargs):
@@ -150,9 +150,9 @@ with gr.Blocks(css=css) as demo:
150
  num_inference_steps = gr.Slider(
151
  label="Number of Inference Steps",
152
  minimum=8,
153
- maximum=50,
154
  step=1,
155
- value=28,
156
  )
157
  upscale_factor = gr.Slider(
158
  label="Upscale Factor",
@@ -225,8 +225,7 @@ with gr.Blocks(css=css) as demo:
225
 
226
  gr.Markdown("**Disclaimer:**")
227
  gr.Markdown(
228
- "This demo is only for research purpose. Jasper cannot be held responsible for the generation of NSFW (Not Safe For Work) content through the use of this demo. Users are solely responsible for any content they create, and it is their obligation to ensure that it adheres to appropriate and ethical standards. Jasper provides the tools, but the responsibility for their use lies with the individual user."
229
- )
230
  gr.on(
231
  [run_button.click],
232
  fn=infer,
@@ -239,8 +238,8 @@ with gr.Blocks(css=css) as demo:
239
  controlnet_conditioning_scale,
240
  ],
241
  outputs=result,
242
- show_api=False,
243
- # show_progress="minimal",
244
  )
245
 
246
- demo.queue().launch(share=False, show_api=False)
 
18
  max-width: 512px;
19
  }
20
  """
21
+ '''
22
  if torch.cuda.is_available():
23
  power_device = "GPU"
24
  device = "cuda"
25
+ else:'''
26
+ power_device = "CPU"
27
+ device = "cpu"
28
 
29
 
30
  huggingface_token = os.getenv("HUGGINFACE_TOKEN")
 
48
  pipe.to(device)
49
 
50
  MAX_SEED = 1000000
51
+ MAX_PIXEL_BUDGET = 512 * 512
52
 
53
 
54
  def process_input(input_image, upscale_factor, **kwargs):
 
150
  num_inference_steps = gr.Slider(
151
  label="Number of Inference Steps",
152
  minimum=8,
153
+ maximum=25,
154
  step=1,
155
+ value=10,
156
  )
157
  upscale_factor = gr.Slider(
158
  label="Upscale Factor",
 
225
 
226
  gr.Markdown("**Disclaimer:**")
227
  gr.Markdown(
228
+
 
229
  gr.on(
230
  [run_button.click],
231
  fn=infer,
 
238
  controlnet_conditioning_scale,
239
  ],
240
  outputs=result,
241
+ show_api=True,
242
+ show_progress="minimal",
243
  )
244
 
245
+ demo.queue().launch(share=False, show_api=True)