Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -56,7 +56,7 @@ def get_images(batch: th.Tensor):
|
|
56 |
""" Display a batch of images inline. """
|
57 |
scaled = ((batch + 1)*127.5).round().clamp(0,255).to(th.uint8).cpu()
|
58 |
reshaped = scaled.permute(2, 0, 3, 1).reshape([batch.shape[2], -1, 3])
|
59 |
-
Image.fromarray(reshaped.numpy())
|
60 |
|
61 |
|
62 |
# Create a classifier-free guidance sampling function
|
@@ -182,8 +182,8 @@ def to_base64(pil_image):
|
|
182 |
|
183 |
title = "Interactive demo: glide-text2im"
|
184 |
description = "Demo for OpenAI's GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models."
|
185 |
-
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/
|
186 |
-
examples =["
|
187 |
|
188 |
iface = gr.Interface(fn=sample,
|
189 |
inputs=gr.inputs.Textbox(label='What would you like to see?'),
|
|
|
56 |
""" Display a batch of images inline. """
|
57 |
scaled = ((batch + 1)*127.5).round().clamp(0,255).to(th.uint8).cpu()
|
58 |
reshaped = scaled.permute(2, 0, 3, 1).reshape([batch.shape[2], -1, 3])
|
59 |
+
return Image.fromarray(reshaped.numpy())
|
60 |
|
61 |
|
62 |
# Create a classifier-free guidance sampling function
|
|
|
182 |
|
183 |
title = "Interactive demo: glide-text2im"
|
184 |
description = "Demo for OpenAI's GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models."
|
185 |
+
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2112.10741'>GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models</a> | <a href='https://github.com/openai/glide-text2im/'>Official Repo</a></p>"
|
186 |
+
examples =["an oil painting of a corgi"]
|
187 |
|
188 |
iface = gr.Interface(fn=sample,
|
189 |
inputs=gr.inputs.Textbox(label='What would you like to see?'),
|