Commit
·
4a0748c
1
Parent(s):
25ef56f
Revert inputs
Browse files
app.py
CHANGED
@@ -32,9 +32,6 @@ def generate_content(
|
|
32 |
transformation,
|
33 |
num_inference_steps,
|
34 |
seed,
|
35 |
-
guidance_scale,
|
36 |
-
noise_level,
|
37 |
-
reduction,
|
38 |
):
|
39 |
prompts = [f'{style} {p}'.strip() for p in [prompt_for_original, prompt_for_transformed]]
|
40 |
prompt_embeds = [stage_1.encode_prompt(p) for p in prompts]
|
@@ -53,9 +50,7 @@ def generate_content(
|
|
53 |
negative_prompt_embeds,
|
54 |
views,
|
55 |
num_inference_steps=num_inference_steps,
|
56 |
-
generator=generator
|
57 |
-
guidance_scale=guidance_scale,
|
58 |
-
reduction=reduction)
|
59 |
|
60 |
print("Sample stage 2")
|
61 |
image = sample_stage_2(stage_2,
|
@@ -64,10 +59,7 @@ def generate_content(
|
|
64 |
negative_prompt_embeds,
|
65 |
views,
|
66 |
num_inference_steps=num_inference_steps,
|
67 |
-
generator=generator
|
68 |
-
guidance_scale=guidance_scale,
|
69 |
-
noise_level=noise_level,
|
70 |
-
reduction=reduction)
|
71 |
save_illusion(image, views, Path(""))
|
72 |
|
73 |
output_name = f"illusion.mp4"
|
@@ -94,11 +86,8 @@ gradio_app = gr.Interface(
|
|
94 |
gr.Textbox(label="Prompt for original view", placeholder="a dress"),
|
95 |
gr.Textbox(label="Prompt for transformed view", placeholder="an old man"),
|
96 |
gr.Dropdown(label="View transformation", choices=choices, value=choices[0]),
|
97 |
-
gr.Number(label="Number of diffusion steps", value=
|
98 |
gr.Number(label="Random seed", value=0, step=1, minimum=0, maximum=100000),
|
99 |
-
gr.Number(label="Guidance scale", value=7, step=1, minimum=1, maximum=10, info="How strongly diffusion is guided by the prompts"),
|
100 |
-
gr.Number(label="Noise level", value=50, step=1, minimum=1, maximum=100, info="Noise level for stage 2 of diffusion sampling", visible=False),
|
101 |
-
gr.Dropdown(label="Reduction", choices=["mean", "alternate"], value="mean", info="Method for reducing predicted noise and variances", visible=False),
|
102 |
],
|
103 |
outputs=[gr.Video(label="Illusion"), gr.Image(label="Before and After")],
|
104 |
description=description,
|
|
|
32 |
transformation,
|
33 |
num_inference_steps,
|
34 |
seed,
|
|
|
|
|
|
|
35 |
):
|
36 |
prompts = [f'{style} {p}'.strip() for p in [prompt_for_original, prompt_for_transformed]]
|
37 |
prompt_embeds = [stage_1.encode_prompt(p) for p in prompts]
|
|
|
50 |
negative_prompt_embeds,
|
51 |
views,
|
52 |
num_inference_steps=num_inference_steps,
|
53 |
+
generator=generator)
|
|
|
|
|
54 |
|
55 |
print("Sample stage 2")
|
56 |
image = sample_stage_2(stage_2,
|
|
|
59 |
negative_prompt_embeds,
|
60 |
views,
|
61 |
num_inference_steps=num_inference_steps,
|
62 |
+
generator=generator)
|
|
|
|
|
|
|
63 |
save_illusion(image, views, Path(""))
|
64 |
|
65 |
output_name = f"illusion.mp4"
|
|
|
86 |
gr.Textbox(label="Prompt for original view", placeholder="a dress"),
|
87 |
gr.Textbox(label="Prompt for transformed view", placeholder="an old man"),
|
88 |
gr.Dropdown(label="View transformation", choices=choices, value=choices[0]),
|
89 |
+
gr.Number(label="Number of diffusion steps", value=30, step=1, minimum=1, maximum=300),
|
90 |
gr.Number(label="Random seed", value=0, step=1, minimum=0, maximum=100000),
|
|
|
|
|
|
|
91 |
],
|
92 |
outputs=[gr.Video(label="Illusion"), gr.Image(label="Before and After")],
|
93 |
description=description,
|