Spaces:
Runtime error
Runtime error
Commit
·
5273c29
1
Parent(s):
1f14d54
app.py
CHANGED
@@ -16,12 +16,15 @@ context = Context(STABILITY_HOST, STABILITY_KEY)
|
|
16 |
context.get_user_info()
|
17 |
print("Connection successfuly!")
|
18 |
|
19 |
-
def anim(f_promt, s_promt):
|
|
|
|
|
|
|
20 |
# Configure the animation
|
21 |
args = AnimationArgs()
|
22 |
args.interpolate_prompts = True
|
23 |
args.locked_seed = True
|
24 |
-
args.max_frames =
|
25 |
args.seed = 42
|
26 |
args.strength_curve = "0:(0)"
|
27 |
args.diffusion_cadence_curve = "0:(4)"
|
@@ -29,7 +32,7 @@ def anim(f_promt, s_promt):
|
|
29 |
|
30 |
animation_prompts = {
|
31 |
0: f_promt,
|
32 |
-
|
33 |
}
|
34 |
negative_prompt = ""
|
35 |
|
@@ -52,12 +55,13 @@ def anim(f_promt, s_promt):
|
|
52 |
|
53 |
with gr.Blocks() as demo:
|
54 |
gr.Markdown("Stability Animation")
|
55 |
-
f_promt = gr.Textbox(label="
|
56 |
-
s_promt = gr.Textbox(label="
|
|
|
57 |
|
58 |
outimg = gr.Files(label="Generated Files")
|
59 |
btn = gr.Button('Anim')
|
60 |
|
61 |
-
btn.click(fn=anim, inputs=[f_promt,s_promt], outputs=[outimg],api_name="AnimAPI")
|
62 |
|
63 |
demo.launch()
|
|
|
16 |
context.get_user_info()
|
17 |
print("Connection successfuly!")
|
18 |
|
19 |
+
def anim(f_promt, s_promt, stability_key):
|
20 |
+
# Connect to Stability API
|
21 |
+
context = Context(STABILITY_HOST, stability_key)
|
22 |
+
|
23 |
# Configure the animation
|
24 |
args = AnimationArgs()
|
25 |
args.interpolate_prompts = True
|
26 |
args.locked_seed = True
|
27 |
+
args.max_frames = 20
|
28 |
args.seed = 42
|
29 |
args.strength_curve = "0:(0)"
|
30 |
args.diffusion_cadence_curve = "0:(4)"
|
|
|
32 |
|
33 |
animation_prompts = {
|
34 |
0: f_promt,
|
35 |
+
10: s_promt,
|
36 |
}
|
37 |
negative_prompt = ""
|
38 |
|
|
|
55 |
|
56 |
with gr.Blocks() as demo:
|
57 |
gr.Markdown("Stability Animation")
|
58 |
+
f_promt = gr.Textbox(label="First Prompt", value="a photo of a cute cat")
|
59 |
+
s_promt = gr.Textbox(label="Second Prompt", value="a photo of a cute dog")
|
60 |
+
stability_key = gr.Textbox(label="Stability Key", value="")
|
61 |
|
62 |
outimg = gr.Files(label="Generated Files")
|
63 |
btn = gr.Button('Anim')
|
64 |
|
65 |
+
btn.click(fn=anim, inputs=[f_promt, s_promt, stability_key], outputs=[outimg],api_name="AnimAPI")
|
66 |
|
67 |
demo.launch()
|