Spaces:
Runtime error
Runtime error
Commit
·
ac4e020
1
Parent(s):
91ed88f
Upload 2 files
Browse files- app.py +24 -0
- requirements.txt +0 -0
app.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#@title Connect to the Stability API
|
2 |
+
import getpass
|
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 |
+
STABILITY_KEY = getpass.getpass('Enter your API Key')
|
9 |
+
|
10 |
+
# Connect to Stability API
|
11 |
+
context = Context(STABILITY_HOST, STABILITY_KEY)
|
12 |
+
|
13 |
+
# Test the connection
|
14 |
+
context.get_user_info()
|
15 |
+
print("Connection successful!")
|
16 |
+
|
17 |
+
#@title Animation UI
|
18 |
+
show_ui_in_notebook = True #@param {type:"boolean"}
|
19 |
+
|
20 |
+
outputs_path = r'C:\Work\tst\SAnim'
|
21 |
+
|
22 |
+
ui = create_ui(context, outputs_path)
|
23 |
+
ui.queue(concurrency_count=2, max_size=2)
|
24 |
+
ui.launch(show_api=False, debug=True, inline=show_ui_in_notebook, height=768, share=True, show_error=True)
|
requirements.txt
ADDED
File without changes
|