#@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)