Spaces:
Sleeping
Sleeping
Add gr.Workflow app entrypoint
Browse files1234567891011121314151617181920212223242526272829import gradio as gr
def stylize(prompt: str) -> str: """Bound Python function exposed as a canvas node.
Appends a cinematic style suffix to the prompt before it is sent to the Kandinsky Space. Delete the node on the canvas (and its edges) if you want raw prompts instead. """ prompt = (prompt or "").strip() if not prompt: return prompt return f"{prompt}, cinematic lighting, highly detailed, smooth camera motion"
# gr.Workflow is a complete Gradio app and must be created at top level.# graph= loads the saved topology from workflow.json (created on first# authorized edit if missing); bind= exposes `stylize` as the fn node# named "Stylize Prompt" in the graph.app = gr.Workflow( graph="workflow.json", bind={"Stylize Prompt": stylize},)
if __name__ == "__main__": # Video generation on the Kandinsky Space takes ~4-5 minutes per run, # so allow generous queueing. app.queue(max_size=32, default_concurrency_limit=2).launch()app.pyAdded+29