File size: 926 Bytes
ff3c6aa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#@title Connect to the Stability API
import os
from stability_sdk.api import Context
from stability_sdk.animation_ui import create_ui

# @markdown To get your API key visit https://dreamstudio.ai/account
STABILITY_HOST = "grpc.stability.ai:443" #@param {type:"string"}
STABILITY_KEY = os.getenv("STABILITY_KEY")

# Connect to Stability API
context = Context(STABILITY_HOST, STABILITY_KEY)

# Test the connection
context.get_user_info()
print("Connection successful!")

#@title Animation UI
show_ui_in_notebook = True #@param {type:"boolean"}

outputs_path = r'C:\Work\tst\SAnim'



# Create UI
interface = create_ui(context, outputs_path)

# Set concurrency_limit on the Interface
interface = gr.Interface(fn=interface.fn, inputs=interface.inputs, outputs=interface.outputs, concurrency_limit=2)

# Launch the UI
interface.launch(show_api=False, debug=True, inline=show_ui_in_notebook, height=768, share=True, show_error=True)