Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ pipe.to(device=device, dtype=torch_dtype)
|
|
36 |
MAX_SEED = np.iinfo(np.int32).max
|
37 |
|
38 |
@spaces.GPU
|
39 |
-
def infer(prompt, seed, randomize_seed, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
40 |
prompt_template = f"A side by side 4 frame image showing consecutive stills from a looped gif moving from left to right. The gif is {prompt}"
|
41 |
if randomize_seed:
|
42 |
seed = random.randint(0, MAX_SEED)
|
@@ -56,9 +56,9 @@ def infer(prompt, seed, randomize_seed, num_inference_steps, progress=gr.Progres
|
|
56 |
return gif_name, gr.update(value=image, visible=True), seed
|
57 |
|
58 |
examples = [
|
59 |
-
"
|
60 |
-
"
|
61 |
-
"A
|
62 |
]
|
63 |
|
64 |
css="""
|
@@ -113,7 +113,10 @@ with gr.Blocks(css=css) as demo:
|
|
113 |
|
114 |
gr.Examples(
|
115 |
examples = examples,
|
116 |
-
inputs = [prompt]
|
|
|
|
|
|
|
117 |
)
|
118 |
gr.on(
|
119 |
triggers=[run_button.click, prompt.submit],
|
|
|
36 |
MAX_SEED = np.iinfo(np.int32).max
|
37 |
|
38 |
@spaces.GPU
|
39 |
+
def infer(prompt, seed=42, randomize_seed=False, num_inference_steps=8, progress=gr.Progress(track_tqdm=True)):
|
40 |
prompt_template = f"A side by side 4 frame image showing consecutive stills from a looped gif moving from left to right. The gif is {prompt}"
|
41 |
if randomize_seed:
|
42 |
seed = random.randint(0, MAX_SEED)
|
|
|
56 |
return gif_name, gr.update(value=image, visible=True), seed
|
57 |
|
58 |
examples = [
|
59 |
+
"a cute cat raising their paws in the air and waving hello. There is a sign over the cat's head that says "Flux does Video?!"",
|
60 |
+
"Will Smith eating pizza",
|
61 |
+
"A flying saucer over the white house",
|
62 |
]
|
63 |
|
64 |
css="""
|
|
|
113 |
|
114 |
gr.Examples(
|
115 |
examples = examples,
|
116 |
+
inputs = [prompt],
|
117 |
+
outputs = [result, result_full, seed],
|
118 |
+
fn=infer,
|
119 |
+
cache_examples="lazy"
|
120 |
)
|
121 |
gr.on(
|
122 |
triggers=[run_button.click, prompt.submit],
|