hysts HF staff commited on
Commit
0d7fcf2
β€’
1 Parent(s): e856705

Minor fix for ZeroGPU

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -56,6 +56,7 @@ pipe = load_evo_nishikie(device)
56
  pipe.scheduler = EulerDiscreteScheduler.from_config(
57
  pipe.scheduler.config, use_karras_sigmas=True,
58
  )
 
59
  # pipe.unet.to(memory_format=torch.channels_last)
60
  # pipe.controlnet.to(memory_format=torch.channels_last)
61
  # pipe.vae.to(memory_format=torch.channels_last)
@@ -84,8 +85,6 @@ def generate(
84
  randomize_seed: bool = False,
85
  progress=gr.Progress(track_tqdm=True),
86
  ):
87
- pipe.to(device)
88
-
89
  lineart_image = lineart_detector(input_image, coarse=False, image_resolution=1024)
90
  lineart_image_filtered = lineart_image.filter(image_filter)
91
  conditioning_image = lineart_image_filtered.point(lambda p: 255 if p > BINARY_THRESHOLD else 0).convert("L")
@@ -159,4 +158,4 @@ with gr.Blocks(css=css) as demo:
159
 
160
  ε‡Ίε…ΈοΌšγ‚΅γƒ³γƒ—γƒ«η”»εƒγ―γ™γΉγ¦[ζ—₯ζœ¬ε€ε…Έη±γƒ‡γƒΌγ‚Ώγ‚»γƒƒγƒˆοΌˆε›½ζ–‡ε­¦η ”η©Άθ³‡ζ–™ι€¨θ”΅οΌ‰γ€Žη΅΅ζœ¬ηŽ‰γ‹γ€γ‚‰γ€](http://codh.rois.ac.jp/pmjt/book/200013861/)γ‹γ‚‰εΌ•η”¨γ—γΎγ—γŸγ€‚""")
161
 
162
- demo.queue().launch()
 
56
  pipe.scheduler = EulerDiscreteScheduler.from_config(
57
  pipe.scheduler.config, use_karras_sigmas=True,
58
  )
59
+ pipe.to(device=device, dtype=torch.float16)
60
  # pipe.unet.to(memory_format=torch.channels_last)
61
  # pipe.controlnet.to(memory_format=torch.channels_last)
62
  # pipe.vae.to(memory_format=torch.channels_last)
 
85
  randomize_seed: bool = False,
86
  progress=gr.Progress(track_tqdm=True),
87
  ):
 
 
88
  lineart_image = lineart_detector(input_image, coarse=False, image_resolution=1024)
89
  lineart_image_filtered = lineart_image.filter(image_filter)
90
  conditioning_image = lineart_image_filtered.point(lambda p: 255 if p > BINARY_THRESHOLD else 0).convert("L")
 
158
 
159
  ε‡Ίε…ΈοΌšγ‚΅γƒ³γƒ—γƒ«η”»εƒγ―γ™γΉγ¦[ζ—₯ζœ¬ε€ε…Έη±γƒ‡γƒΌγ‚Ώγ‚»γƒƒγƒˆοΌˆε›½ζ–‡ε­¦η ”η©Άθ³‡ζ–™ι€¨θ”΅οΌ‰γ€Žη΅΅ζœ¬ηŽ‰γ‹γ€γ‚‰γ€](http://codh.rois.ac.jp/pmjt/book/200013861/)γ‹γ‚‰εΌ•η”¨γ—γΎγ—γŸγ€‚""")
160
 
161
+ demo.queue().launch()