Gradio Client icon

Gradio Client

Connect to Gradio Spaces and call their API functions

Overview

This node interacts with Gradio Spaces, which are web-hosted machine learning demos or applications. Specifically, the "Get Space Info" operation retrieves metadata and details about a given Gradio Space URL. This is useful for users who want to programmatically access information about public or private Gradio Spaces, such as their status, configuration, or available functions.

Common scenarios include:

  • Monitoring the availability or status of a Gradio Space.
  • Fetching metadata before invoking specific functions on the Space.
  • Integrating Gradio Spaces into automated workflows where space info is needed dynamically.

Example: A user wants to check if a private Gradio Space is accessible and retrieve its description or other metadata before running inference calls.

Properties

Name Meaning
Authentication Choose authentication method:
- None: Public space, no authentication needed.
- HuggingFace API: Private space requiring an API key credential.
Space URL Full URL of the Gradio Space to query, e.g., https://username-spacename.hf.space.
Advanced Options Additional optional settings:
- Timeout: Maximum wait time in seconds (default 120).
- Session Hash: Identifier for the API call session; auto-generated if empty.
- Return Full Response: Whether to return the complete API response or just the data.
- Retry Attempts: Number of retry attempts for failed requests (1-5).
- Debug Mode: Enable detailed logging for troubleshooting.

Output

The node outputs JSON data containing the retrieved information about the specified Gradio Space. The exact structure depends on the Space's API response but generally includes metadata such as:

  • Space name and description
  • Status or availability
  • Configuration details
  • Possibly other relevant fields returned by the Gradio Space info endpoint

If "Return Full Response" is enabled, the entire raw response from the API is returned instead of just the parsed data.

No binary data output is indicated.

Dependencies

  • Requires internet access to reach the specified Gradio Space URL.
  • For private spaces, requires an API key credential for HuggingFace authentication.
  • No additional external services beyond the Gradio Space API itself.
  • Node configuration must include the appropriate API key credential when using authenticated access.

Troubleshooting

  • Missing or invalid API key: If using HuggingFace authentication, ensure that a valid API key credential is configured. The node will throw an error if credentials are missing or invalid.
  • Invalid Space URL: Ensure the Space URL is correctly formatted and reachable.
  • Timeouts: If the Space does not respond within the specified timeout, the request may fail. Adjust the timeout setting as needed.
  • Retry attempts exceeded: Network issues or temporary unavailability might cause retries to fail. Check network connectivity and Space status.
  • Unknown operation error: This node only supports predefined operations; specifying an unsupported operation will cause an error.
  • Debug mode: Enable debug mode to get detailed logs helpful for diagnosing issues.

Links and References

Discussion