Ahsen Khaliq commited on
Commit
8c7ce11
1 Parent(s): 282c9c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -109,7 +109,7 @@ def inference(text,steps,image):
109
  all_frames = []
110
  target = clip_model.embed_text(text)
111
  if image:
112
- target = embed_image(image.name)
113
  else:
114
  target = clip_model.embed_text(text)
115
  steps = steps
@@ -165,7 +165,7 @@ def inference(text,steps,image):
165
 
166
  title = "StyleGAN3+CLIP"
167
  description = "Gradio demo for StyleGAN3+CLIP: Generates images (mostly faces) using StyleGAN3 with CLIP guidance. To use it, simply add your text, or click one of the examples to load them. Read more at the links below."
168
- article = "<p style='text-align: center'><a href='https://colab.research.google.com/drive/1eYlenR1GHPZXt-YuvXabzO9wfh9CWY36' target='_blank'>Colab</a>Written by nshepperd (https://twitter.com/nshepperd1, https://github.com/nshepperd). Thanks to Katherine Crowson (https://twitter.com/RiversHaveWings, https://github.com/crowsonkb) for coming up with many improved sampling tricks, as well as some of the code</p>"
169
  examples = [['mario',150,None]]
170
  gr.Interface(
171
  inference,
 
109
  all_frames = []
110
  target = clip_model.embed_text(text)
111
  if image:
112
+ target = embed_image(TF.to_tensor(image.name).to(device).unsqueeze(0)).mean(0).squeeze(0)
113
  else:
114
  target = clip_model.embed_text(text)
115
  steps = steps
 
165
 
166
  title = "StyleGAN3+CLIP"
167
  description = "Gradio demo for StyleGAN3+CLIP: Generates images (mostly faces) using StyleGAN3 with CLIP guidance. To use it, simply add your text, or click one of the examples to load them. Read more at the links below."
168
+ article = "<p style='text-align: center'><a href='https://colab.research.google.com/drive/1eYlenR1GHPZXt-YuvXabzO9wfh9CWY36' target='_blank'>Colab</a> Written by nshepperd (https://twitter.com/nshepperd1, https://github.com/nshepperd). Thanks to Katherine Crowson (https://twitter.com/RiversHaveWings, https://github.com/crowsonkb) for coming up with many improved sampling tricks, as well as some of the code</p>"
169
  examples = [['mario',150,None]]
170
  gr.Interface(
171
  inference,