Boboiazumi commited on
Commit
7c5a410
1 Parent(s): 40ca4cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -18
app.py CHANGED
@@ -38,15 +38,6 @@ torch.backends.cudnn.benchmark = False
38
 
39
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
40
 
41
- def fake_generate(*args,use_upscaler=False,**kwargs):
42
- print(args)
43
- print(type(args))
44
- args = ",".join(args)
45
- print(args)
46
- print(type(args))
47
-
48
- return None, None
49
-
50
  def load_pipeline(model_name):
51
  vae = AutoencoderKL.from_pretrained(
52
  "madebyollin/sdxl-vae-fp16-fix",
@@ -280,6 +271,12 @@ def generate(
280
 
281
  utils.free_memory()
282
 
 
 
 
 
 
 
283
 
284
  if torch.cuda.is_available():
285
  pipe, img_pipe = load_pipeline(MODEL)
@@ -328,7 +325,7 @@ with gr.Blocks(css="style.css", theme="NoCrypt/[email protected]") as demo:
328
  image = gr.Image(
329
  sources=["upload", "webcam", "clipboard"],
330
  type="filepath",
331
- visible=False,
332
  label="Choose Image",
333
  )
334
  img2img_strength = gr.Slider(
@@ -337,7 +334,7 @@ with gr.Blocks(css="style.css", theme="NoCrypt/[email protected]") as demo:
337
  step=0.05,
338
  value=0.65,
339
  label="Strength",
340
- visible=False
341
  )
342
  with gr.Accordion(label="Quality Tags", open=True):
343
  add_quality_tags = gr.Checkbox(
@@ -454,13 +451,13 @@ with gr.Blocks(css="style.css", theme="NoCrypt/[email protected]") as demo:
454
  queue=False,
455
  api_name=False,
456
  )
457
- isImg2Img.change(
458
- fn=lambda x: [gr.update(visible=x), gr.update(visible=x)],
459
- inputs=isImg2Img,
460
- outputs=[image, img2img_strength],
461
- queue=False,
462
- api_name=False,
463
- )
464
  aspect_ratio_selector.change(
465
  fn=lambda x: gr.update(visible=x == "Custom"),
466
  inputs=aspect_ratio_selector,
 
38
 
39
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
40
 
 
 
 
 
 
 
 
 
 
41
  def load_pipeline(model_name):
42
  vae = AutoencoderKL.from_pretrained(
43
  "madebyollin/sdxl-vae-fp16-fix",
 
271
 
272
  utils.free_memory()
273
 
274
+ def fake_generate(*args,use_upscaler=False,**kwargs):
275
+ args = ",".join(args)
276
+
277
+ result, metadata = generate(prompt=args, use_upscaler=use_upscaler)
278
+
279
+ return result, metadata
280
 
281
  if torch.cuda.is_available():
282
  pipe, img_pipe = load_pipeline(MODEL)
 
325
  image = gr.Image(
326
  sources=["upload", "webcam", "clipboard"],
327
  type="filepath",
328
+ #visible=False,
329
  label="Choose Image",
330
  )
331
  img2img_strength = gr.Slider(
 
334
  step=0.05,
335
  value=0.65,
336
  label="Strength",
337
+ #visible=False
338
  )
339
  with gr.Accordion(label="Quality Tags", open=True):
340
  add_quality_tags = gr.Checkbox(
 
451
  queue=False,
452
  api_name=False,
453
  )
454
+ #isImg2Img.change(
455
+ # fn=lambda x: [gr.update(visible=x), gr.update(visible=x)],
456
+ # inputs=isImg2Img,
457
+ # outputs=[image, img2img_strength],
458
+ # queue=False,
459
+ # api_name=False,
460
+ #)
461
  aspect_ratio_selector.change(
462
  fn=lambda x: gr.update(visible=x == "Custom"),
463
  inputs=aspect_ratio_selector,