Update app.py
Browse files
app.py
CHANGED
|
@@ -46,6 +46,21 @@ guidance_scale = 3.0
|
|
| 46 |
# A value of 1.0 is sharper, but sometimes results in grainy artifacts.
|
| 47 |
upsample_temp = 0.997
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
import gradio as gr
|
| 50 |
def generate_upsampled_image_from_text(prompt):
|
| 51 |
# Set the prompt text
|
|
|
|
| 46 |
# A value of 1.0 is sharper, but sometimes results in grainy artifacts.
|
| 47 |
upsample_temp = 0.997
|
| 48 |
|
| 49 |
+
samples = diffusion.p_sample_loop(
|
| 50 |
+
model_fn,
|
| 51 |
+
(full_batch_size, 3, options["image_size"], options["image_size"]),
|
| 52 |
+
device=device,
|
| 53 |
+
clip_denoised=True,
|
| 54 |
+
progress=True,
|
| 55 |
+
model_kwargs=model_kwargs,
|
| 56 |
+
cond_fn=None,
|
| 57 |
+
)[:batch_size]
|
| 58 |
+
model.del_cache()
|
| 59 |
+
|
| 60 |
+
# Show the output
|
| 61 |
+
show_images(samples)
|
| 62 |
+
|
| 63 |
+
|
| 64 |
import gradio as gr
|
| 65 |
def generate_upsampled_image_from_text(prompt):
|
| 66 |
# Set the prompt text
|