Spaces:
Runtime error
Runtime error
Commit
Β·
91371eb
1
Parent(s):
5a1daef
Update app.py
Browse files
app.py
CHANGED
|
@@ -84,7 +84,7 @@ print('total base parameters', sum(x.numel() for x in model.parameters()))
|
|
| 84 |
|
| 85 |
|
| 86 |
#@title Create upsampler model.
|
| 87 |
-
sr_glide_path = "glide-ft-
|
| 88 |
|
| 89 |
|
| 90 |
options_up = model_and_diffusion_defaults_upsampler()
|
|
@@ -143,7 +143,7 @@ def sample(prompt):
|
|
| 143 |
|
| 144 |
# Tune this parameter to control the sharpness of 256x256 images.
|
| 145 |
# A value of 1.0 is sharper, but sometimes results in grainy artifacts.
|
| 146 |
-
upsample_temp = 0
|
| 147 |
|
| 148 |
##############################
|
| 149 |
# Sample from the base model #
|
|
@@ -239,10 +239,19 @@ def to_base64(pil_image):
|
|
| 239 |
pil_image.save(buffered, format="JPEG")
|
| 240 |
return base64.b64encode(buffered.getvalue())
|
| 241 |
|
| 242 |
-
title = "Interactive demo: glide-text2im"
|
| 243 |
-
description = "Demo for OpenAI's GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models."
|
| 244 |
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>"
|
| 245 |
-
examples =["
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 246 |
|
| 247 |
iface = gr.Interface(fn=sample,
|
| 248 |
inputs=gr.inputs.Textbox(label='What would you like to see?'),
|
|
|
|
| 84 |
|
| 85 |
|
| 86 |
#@title Create upsampler model.
|
| 87 |
+
sr_glide_path = "glide-ft-16x5000.pt" #@param {type:"string"}
|
| 88 |
|
| 89 |
|
| 90 |
options_up = model_and_diffusion_defaults_upsampler()
|
|
|
|
| 143 |
|
| 144 |
# Tune this parameter to control the sharpness of 256x256 images.
|
| 145 |
# A value of 1.0 is sharper, but sometimes results in grainy artifacts.
|
| 146 |
+
upsample_temp = 1.0
|
| 147 |
|
| 148 |
##############################
|
| 149 |
# Sample from the base model #
|
|
|
|
| 239 |
pil_image.save(buffered, format="JPEG")
|
| 240 |
return base64.b64encode(buffered.getvalue())
|
| 241 |
|
| 242 |
+
title = "Interactive demo: glide-text2im dermoscopic image generator"
|
| 243 |
+
description = "Demo for the Finetuned version of OpenAI's GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Models."
|
| 244 |
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>"
|
| 245 |
+
examples =["put in one of the following examples:
|
| 246 |
+
melanoma
|
| 247 |
+
melanocytic nevi
|
| 248 |
+
Actinic keratoses and intraepithelial carcinoma / Bowen's disease
|
| 249 |
+
benign keratosis-like lesions (solar lentigines / seborrheic keratoses and lichen-planus like keratoses
|
| 250 |
+
basal cell carcinoma
|
| 251 |
+
dermatofibroma
|
| 252 |
+
vascular lesions
|
| 253 |
+
|
| 254 |
+
Please be aware that generation of the image will take up to 20 minutes, as CPU is used for the generation"]
|
| 255 |
|
| 256 |
iface = gr.Interface(fn=sample,
|
| 257 |
inputs=gr.inputs.Textbox(label='What would you like to see?'),
|