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 before sending input data for processing.

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 (e.g., https://username-spacename.hf.space).
Advanced Options Additional optional settings:
- Timeout: Maximum wait time in seconds.
- Session Hash: Identifier for the API session; auto-generated if empty.
- Return Full Response: Whether to return the complete API response or just the main 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 metadata 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 main data.

The node does not output binary data.

Dependencies

  • Requires access to the internet to reach the specified Gradio Space URL.
  • For private spaces, requires an API key credential for HuggingFace authentication.
  • No additional external dependencies beyond standard HTTP request capabilities.
  • Supports configuration of timeout, retries, and debug logging within the node parameters.

Troubleshooting

  • Authentication errors: If using private spaces, ensure that a valid API key credential is provided. Missing or invalid keys will cause authentication failures.
  • Timeouts: Long response times may cause timeouts; increase the "Timeout" advanced option if necessary.
  • Invalid URL: Ensure the Space URL is correctly formatted and reachable.
  • Unknown operation error: This node only supports predefined operations; selecting an unsupported operation will throw an error.
  • Retry attempts: If requests fail intermittently, increasing retry attempts can help.
  • Debug mode: Enable debug mode to get detailed logs for diagnosing issues.

Links and References

Discussion