ideogram-4 / app.py
akhaliq's picture
akhaliq HF Staff
Switch to Space node calling ideogram-ai/ideogram4 /generate
891e4b6
Raw
History Blame Contribute Delete
809 Bytes
import gradio as gr
# This Workflow calls the official Ideogram 4 Space
# (https://huggingface.co/spaces/ideogram-ai/ideogram4) as a `kind: "space"`
# operator node. Gradio's Workflow runner authenticates each Space node with the
# visitor's own Hugging Face OAuth token (gradio@6.19.0 call_space passes the
# resolved token to `gradio_client.Client(...)`), so no server-side API key is
# required — visitors run the pipeline on their own inference entitlement.
#
# The /generate endpoint accepts 7 positional parameters (prompt, mode,
# upsampler, width, height, seed, randomize_seed) and returns a 3-tuple of
# (image, seed, caption). The node in workflow.json declares an input port per
# parameter and an output port per returned value, in that exact order.
gr.Workflow(graph="workflow.json").launch()