Spaces:
Runtime error
Runtime error
Commit
·
1d1f8b7
1
Parent(s):
2bce580
Update app.py
Browse files
app.py
CHANGED
@@ -1,31 +1,23 @@
|
|
1 |
-
|
2 |
-
|
3 |
from stability_sdk.api import Context
|
4 |
from stability_sdk.animation_ui import create_ui
|
5 |
-
import gradio as gr
|
6 |
-
|
7 |
-
STABILITY_HOST = "grpc.stability.ai:443"
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
context = Context(STABILITY_HOST, api_key)
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
print("Connection successful!")
|
16 |
|
17 |
-
|
|
|
|
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
ui.launch(show_api=False, debug=True, inline=True, height=768, share=True, show_error=True)
|
22 |
|
23 |
-
|
24 |
-
api_key = os.getenv('STABILITY_KEY')
|
25 |
-
if not api_key:
|
26 |
-
api_key = getpass.getpass('Enter your API Key')
|
27 |
-
connect_to_stability_api(api_key)
|
28 |
-
return "Done"
|
29 |
|
30 |
-
|
31 |
-
|
|
|
|
1 |
+
#@title Connect to the Stability API
|
2 |
+
|
3 |
from stability_sdk.api import Context
|
4 |
from stability_sdk.animation_ui import create_ui
|
|
|
|
|
|
|
5 |
|
6 |
+
# @markdown To get your API key visit https://dreamstudio.ai/account
|
7 |
+
STABILITY_HOST = "grpc.stability.ai:443" #@param {type:"string"}
|
|
|
8 |
|
9 |
+
# Connect to Stability API
|
10 |
+
context = Context(STABILITY_HOST, STABILITY_KEY)
|
|
|
11 |
|
12 |
+
# Test the connection
|
13 |
+
context.get_user_info()
|
14 |
+
print("Connection successful!")
|
15 |
|
16 |
+
#@title Animation UI
|
17 |
+
show_ui_in_notebook = True #@param {type:"boolean"}
|
|
|
18 |
|
19 |
+
outputs_path = r'C:\Work\tst\SAnim'
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
+
ui = create_ui(context, outputs_path)
|
22 |
+
ui.queue(concurrency_count=2, max_size=2)
|
23 |
+
ui.launch(show_api=False, debug=True, inline=show_ui_in_notebook, height=768, share=True, show_error=True)
|