Spaces:
Runtime error
Runtime error
End stillness
Browse files
app.py
CHANGED
|
@@ -1308,11 +1308,12 @@ def process(input_image,
|
|
| 1308 |
|
| 1309 |
prompts = prompt.split(";")
|
| 1310 |
|
| 1311 |
-
# assert input_image is not None, 'No input image!'
|
| 1312 |
if generation_mode == "text":
|
| 1313 |
-
default_height, default_width =
|
| 1314 |
input_image = np.ones((default_height, default_width, 3), dtype=np.uint8) * 255
|
| 1315 |
print("No input image provided. Using a blank white image.")
|
|
|
|
|
|
|
| 1316 |
|
| 1317 |
yield gr.update(label="Previewed Frames"), None, '', '', gr.update(interactive=False), gr.update(interactive=True), gr.skip()
|
| 1318 |
|
|
@@ -1495,7 +1496,6 @@ with block:
|
|
| 1495 |
image_position = gr.Slider(label="Image position", minimum=0, maximum=100, value=0, step=1, info='0=Video start; 100=Video end (lower quality)')
|
| 1496 |
input_video = gr.Video(sources='upload', label="Input Video", height=320)
|
| 1497 |
end_image = gr.Image(sources='upload', type="numpy", label="End Frame (optional)", height=320)
|
| 1498 |
-
end_stillness = gr.Slider(label="End stillness", minimum=0, maximum=100, value=0, step=1, info='0=Realistic end; 100=Matches exactly the end image (but the time seems to freeze)')
|
| 1499 |
timeless_prompt = gr.Textbox(label="Timeless prompt", info='Used on the whole duration of the generation', value='', placeholder="The creature starts to move, fast motion, fixed camera, focus motion, consistent arm, consistent position, mute colors, insanely detailed")
|
| 1500 |
prompt_number = gr.Slider(label="Timed prompt number", minimum=0, maximum=1000, value=0, step=1, info='Prompts will automatically appear')
|
| 1501 |
|
|
@@ -1522,6 +1522,7 @@ with block:
|
|
| 1522 |
n_prompt = gr.Textbox(label="Negative Prompt", value="Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth", info='Requires using normal CFG (undistilled) instead of Distilled (set Distilled=1 and CFG > 1).')
|
| 1523 |
|
| 1524 |
fps_number = gr.Slider(label="Frame per seconds", info="The model is trained for 30 fps so other fps may generate weird results", minimum=10, maximum=60, value=30, step=1)
|
|
|
|
| 1525 |
|
| 1526 |
latent_window_size = gr.Slider(label="Latent Window Size", minimum=1, maximum=33, value=9, step=1, info='Generate more frames at a time (larger chunks). Less degradation and better blending but higher VRAM cost. Should not change.')
|
| 1527 |
steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1, info='Increase for more quality, especially if using high non-distilled CFG. If your animation has very few motion, you may have brutal brightness change; this can be fixed increasing the steps.')
|
|
@@ -1762,7 +1763,7 @@ with block:
|
|
| 1762 |
0, # image_position
|
| 1763 |
"A woman jumps out of the train and arrives on the ground, viewed from the outside, photorealistic, realistic, amateur photography, midday, insanely detailed, 8k",
|
| 1764 |
"start_end", # generation_mode
|
| 1765 |
-
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth, jumpcut", # n_prompt
|
| 1766 |
True, # randomize_seed
|
| 1767 |
42, # seed
|
| 1768 |
True, # auto_allocation
|
|
@@ -1795,9 +1796,9 @@ with block:
|
|
| 1795 |
[
|
| 1796 |
"./img_examples/Example1.mp4", # input_video
|
| 1797 |
None, # end_image
|
| 1798 |
-
|
| 1799 |
"View of the sea as far as the eye can see, from the seaside, a piece of land is barely visible on the horizon at the middle, the sky is radiant, reflections of the sun in the water, photorealistic, realistic, intricate details, 8k, insanely detailed",
|
| 1800 |
-
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth", # n_prompt
|
| 1801 |
True, # randomize_seed
|
| 1802 |
42, # seed
|
| 1803 |
True, # auto_allocation
|
|
@@ -1823,7 +1824,7 @@ with block:
|
|
| 1823 |
None, # end_image
|
| 1824 |
1, # end_stillness
|
| 1825 |
"View of the sea as far as the eye can see, from the seaside, a piece of land is barely visible on the horizon at the middle, the sky is radiant, reflections of the sun in the water, photorealistic, realistic, intricate details, 8k, insanely detailed",
|
| 1826 |
-
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth", # n_prompt
|
| 1827 |
True, # randomize_seed
|
| 1828 |
42, # seed
|
| 1829 |
True, # auto_allocation
|
|
@@ -1847,9 +1848,9 @@ with block:
|
|
| 1847 |
[
|
| 1848 |
"./img_examples/Example1.mp4", # input_video
|
| 1849 |
None, # end_image
|
| 1850 |
-
|
| 1851 |
"View of the sea as far as the eye can see, from the seaside, a piece of land is barely visible on the horizon at the middle, the sky is radiant, reflections of the sun in the water, photorealistic, realistic, intricate details, 8k, insanely detailed",
|
| 1852 |
-
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth", # n_prompt
|
| 1853 |
True, # randomize_seed
|
| 1854 |
42, # seed
|
| 1855 |
True, # auto_allocation
|
|
@@ -2053,7 +2054,7 @@ with block:
|
|
| 2053 |
0, # image_position
|
| 2054 |
"A woman jumps out of the train and arrives on the ground, viewed from the outside, photorealistic, realistic, amateur photography, midday, insanely detailed, 8k", # prompt
|
| 2055 |
"start_end", # generation_mode
|
| 2056 |
-
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth, jumpcut", # n_prompt
|
| 2057 |
True, # randomize_seed
|
| 2058 |
42, # seed
|
| 2059 |
True, # auto_allocation
|
|
@@ -2085,9 +2086,9 @@ with block:
|
|
| 2085 |
[
|
| 2086 |
"./img_examples/Example1.mp4", # input_video
|
| 2087 |
None, # end_image
|
| 2088 |
-
|
| 2089 |
"View of the sea as far as the eye can see, from the seaside, a piece of land is barely visible on the horizon at the middle, the sky is radiant, reflections of the sun in the water, photorealistic, realistic, intricate details, 8k, insanely detailed",
|
| 2090 |
-
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth", # n_prompt
|
| 2091 |
True, # randomize_seed
|
| 2092 |
42, # seed
|
| 2093 |
True, # auto_allocation
|
|
@@ -2111,9 +2112,9 @@ with block:
|
|
| 2111 |
[
|
| 2112 |
"./img_examples/Example1.mp4", # input_video
|
| 2113 |
"./img_examples/Example1.png", # end_image
|
| 2114 |
-
|
| 2115 |
"View of the sea as far as the eye can see, from the seaside, a piece of land is barely visible on the horizon at the middle, the sky is radiant, reflections of the sun in the water, photorealistic, realistic, intricate details, 8k, insanely detailed",
|
| 2116 |
-
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth", # n_prompt
|
| 2117 |
True, # randomize_seed
|
| 2118 |
42, # seed
|
| 2119 |
True, # auto_allocation
|
|
@@ -2205,7 +2206,7 @@ with block:
|
|
| 2205 |
gr.update(visible = False), # image_position
|
| 2206 |
gr.update(visible = True), # input_image
|
| 2207 |
gr.update(visible = True), # end_image
|
| 2208 |
-
gr.update(visible =
|
| 2209 |
gr.update(visible = False), # input_video
|
| 2210 |
gr.update(visible = True), # start_button
|
| 2211 |
gr.update(visible = False), # start_button_video
|
|
|
|
| 1308 |
|
| 1309 |
prompts = prompt.split(";")
|
| 1310 |
|
|
|
|
| 1311 |
if generation_mode == "text":
|
| 1312 |
+
default_height, default_width = resolution, resolution
|
| 1313 |
input_image = np.ones((default_height, default_width, 3), dtype=np.uint8) * 255
|
| 1314 |
print("No input image provided. Using a blank white image.")
|
| 1315 |
+
assert input_image is not None, 'No input image!'
|
| 1316 |
+
assert (generation_mode != "start_end") or end_image is not None, 'No end image!'
|
| 1317 |
|
| 1318 |
yield gr.update(label="Previewed Frames"), None, '', '', gr.update(interactive=False), gr.update(interactive=True), gr.skip()
|
| 1319 |
|
|
|
|
| 1496 |
image_position = gr.Slider(label="Image position", minimum=0, maximum=100, value=0, step=1, info='0=Video start; 100=Video end (lower quality)')
|
| 1497 |
input_video = gr.Video(sources='upload', label="Input Video", height=320)
|
| 1498 |
end_image = gr.Image(sources='upload', type="numpy", label="End Frame (optional)", height=320)
|
|
|
|
| 1499 |
timeless_prompt = gr.Textbox(label="Timeless prompt", info='Used on the whole duration of the generation', value='', placeholder="The creature starts to move, fast motion, fixed camera, focus motion, consistent arm, consistent position, mute colors, insanely detailed")
|
| 1500 |
prompt_number = gr.Slider(label="Timed prompt number", minimum=0, maximum=1000, value=0, step=1, info='Prompts will automatically appear')
|
| 1501 |
|
|
|
|
| 1522 |
n_prompt = gr.Textbox(label="Negative Prompt", value="Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth", info='Requires using normal CFG (undistilled) instead of Distilled (set Distilled=1 and CFG > 1).')
|
| 1523 |
|
| 1524 |
fps_number = gr.Slider(label="Frame per seconds", info="The model is trained for 30 fps so other fps may generate weird results", minimum=10, maximum=60, value=30, step=1)
|
| 1525 |
+
end_stillness = gr.Slider(label="End stillness", minimum=0, maximum=100, value=1, step=1, info='0=Realistic end; >0=Matches exactly the end image (but the time seems to freeze)')
|
| 1526 |
|
| 1527 |
latent_window_size = gr.Slider(label="Latent Window Size", minimum=1, maximum=33, value=9, step=1, info='Generate more frames at a time (larger chunks). Less degradation and better blending but higher VRAM cost. Should not change.')
|
| 1528 |
steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1, info='Increase for more quality, especially if using high non-distilled CFG. If your animation has very few motion, you may have brutal brightness change; this can be fixed increasing the steps.')
|
|
|
|
| 1763 |
0, # image_position
|
| 1764 |
"A woman jumps out of the train and arrives on the ground, viewed from the outside, photorealistic, realistic, amateur photography, midday, insanely detailed, 8k",
|
| 1765 |
"start_end", # generation_mode
|
| 1766 |
+
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth, jumpcut, crossfader, crossfading", # n_prompt
|
| 1767 |
True, # randomize_seed
|
| 1768 |
42, # seed
|
| 1769 |
True, # auto_allocation
|
|
|
|
| 1796 |
[
|
| 1797 |
"./img_examples/Example1.mp4", # input_video
|
| 1798 |
None, # end_image
|
| 1799 |
+
1, # end_stillness
|
| 1800 |
"View of the sea as far as the eye can see, from the seaside, a piece of land is barely visible on the horizon at the middle, the sky is radiant, reflections of the sun in the water, photorealistic, realistic, intricate details, 8k, insanely detailed",
|
| 1801 |
+
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth, jumpcut, crossfader, crossfading", # n_prompt
|
| 1802 |
True, # randomize_seed
|
| 1803 |
42, # seed
|
| 1804 |
True, # auto_allocation
|
|
|
|
| 1824 |
None, # end_image
|
| 1825 |
1, # end_stillness
|
| 1826 |
"View of the sea as far as the eye can see, from the seaside, a piece of land is barely visible on the horizon at the middle, the sky is radiant, reflections of the sun in the water, photorealistic, realistic, intricate details, 8k, insanely detailed",
|
| 1827 |
+
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth, jumpcut, crossfader, crossfading", # n_prompt
|
| 1828 |
True, # randomize_seed
|
| 1829 |
42, # seed
|
| 1830 |
True, # auto_allocation
|
|
|
|
| 1848 |
[
|
| 1849 |
"./img_examples/Example1.mp4", # input_video
|
| 1850 |
None, # end_image
|
| 1851 |
+
1, # end_stillness
|
| 1852 |
"View of the sea as far as the eye can see, from the seaside, a piece of land is barely visible on the horizon at the middle, the sky is radiant, reflections of the sun in the water, photorealistic, realistic, intricate details, 8k, insanely detailed",
|
| 1853 |
+
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth, jumpcut, crossfader, crossfading", # n_prompt
|
| 1854 |
True, # randomize_seed
|
| 1855 |
42, # seed
|
| 1856 |
True, # auto_allocation
|
|
|
|
| 2054 |
0, # image_position
|
| 2055 |
"A woman jumps out of the train and arrives on the ground, viewed from the outside, photorealistic, realistic, amateur photography, midday, insanely detailed, 8k", # prompt
|
| 2056 |
"start_end", # generation_mode
|
| 2057 |
+
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth, jumpcut, crossfader, crossfading", # n_prompt
|
| 2058 |
True, # randomize_seed
|
| 2059 |
42, # seed
|
| 2060 |
True, # auto_allocation
|
|
|
|
| 2086 |
[
|
| 2087 |
"./img_examples/Example1.mp4", # input_video
|
| 2088 |
None, # end_image
|
| 2089 |
+
1, # end_stillness
|
| 2090 |
"View of the sea as far as the eye can see, from the seaside, a piece of land is barely visible on the horizon at the middle, the sky is radiant, reflections of the sun in the water, photorealistic, realistic, intricate details, 8k, insanely detailed",
|
| 2091 |
+
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth, jumpcut, crossfader, crossfading", # n_prompt
|
| 2092 |
True, # randomize_seed
|
| 2093 |
42, # seed
|
| 2094 |
True, # auto_allocation
|
|
|
|
| 2112 |
[
|
| 2113 |
"./img_examples/Example1.mp4", # input_video
|
| 2114 |
"./img_examples/Example1.png", # end_image
|
| 2115 |
+
1, # end_stillness
|
| 2116 |
"View of the sea as far as the eye can see, from the seaside, a piece of land is barely visible on the horizon at the middle, the sky is radiant, reflections of the sun in the water, photorealistic, realistic, intricate details, 8k, insanely detailed",
|
| 2117 |
+
"Missing arm, long hand, unrealistic position, impossible contortion, visible bone, muscle contraction, poorly framed, blurred, blurry, over-smooth, jumpcut, crossfader, crossfading", # n_prompt
|
| 2118 |
True, # randomize_seed
|
| 2119 |
42, # seed
|
| 2120 |
True, # auto_allocation
|
|
|
|
| 2206 |
gr.update(visible = False), # image_position
|
| 2207 |
gr.update(visible = True), # input_image
|
| 2208 |
gr.update(visible = True), # end_image
|
| 2209 |
+
gr.update(visible = False), # end_stillness
|
| 2210 |
gr.update(visible = False), # input_video
|
| 2211 |
gr.update(visible = True), # start_button
|
| 2212 |
gr.update(visible = False), # start_button_video
|