Spaces:
Running
Running
A newer version of the Gradio SDK is available:
6.1.0
metadata
title: HunyuanImage-3.0
emoji: π¨
colorFrom: purple
colorTo: blue
sdk: gradio
sdk_version: 5.44.0
app_file: app.py
pinned: false
short_description: Text-to-Image generation using Tencent HunyuanImage-3.0
π¨ HunyuanImage-3.0 Text-to-Image with Inference API
This Space provides an interface for the Tencent HunyuanImage-3.0 model using Hugging Face Inference API (paid from your account balance).
β What's New
- Real image generation using HF Inference API
- n8n integration via REST API endpoint
- Base64 image output for easy integration
- Automatic token-based authentication
π§ Setup Instructions
1. Get Your HF Token
- Go to Hugging Face Settings > Access Tokens
- Create a new token with
writepermissions - Copy the token (starts with
hf_...)
2. Set Your Token in Space
- Go to Settings
- Find "Variables and secrets" section
- Click "Replace" next to HF_TOKEN
- Paste your actual token (replace the placeholder)
- Click "Save"
3. Restart the Space
After setting the token, click "Restart space" in Settings.
π‘ API Endpoint for n8n Integration
Using the Gradio API
The Space provides a REST API that can be called from n8n using the HTTP Request node.
Endpoint URL:
https://alae65-hunyuanimage-3.hf.space/gradio_api/call/api_generate
n8n HTTP Node Configuration
- Add an HTTP Request node in n8n
- Configure as follows:
Method: POST
URL:
https://alae65-hunyuanimage-3.hf.space/gradio_api/call/api_generate
Body (JSON):
{
"data": [
"A serene mountain landscape with a crystal clear lake",
42,
50
]
}
Parameters:
data[0](string): Your image promptdata[1](integer): Seed number (for reproducibility)data[2](integer): Number of inference steps (10-100)
Response Format: The API returns a JSON with:
{
"success": true,
"image_base64": "iVBORw0KGgoAAAANSUhEUg...",
"seed": 42,
"status": "Success!",
"prompt": "A serene mountain landscape..."
}
Example n8n Workflow
- Trigger β Webhook or Schedule
- HTTP Request β Call HunyuanImage API
- Code β Decode base64 image if needed
- Save or Send β Store image or send via email/Slack
Python Example
import requests
import base64
from PIL import Image
from io import BytesIO
url = "https://alae65-hunyuanimage-3.hf.space/gradio_api/call/api_generate"
payload = {
"data": [
"A beautiful sunset over the ocean",
42,
50
]
}
response = requests.post(url, json=payload)
result = response.json()
if result.get("success"):
# Decode base64 image
image_data = base64.b64decode(result["image_base64"])
image = Image.open(BytesIO(image_data))
image.save("output.png")
print("Image saved successfully!")
π― Features
- π― Advanced prompt understanding
- πΌοΈ Multiple resolution support
- π² Seed control for reproducibility
- βοΈ Configurable diffusion steps (10-100)
- π Example prompts included
- π REST API for n8n and automation
- π¦ Base64 image encoding
π° Pricing
This Space uses the Hugging Face Inference API which is billed based on usage:
- Cost is deducted from your HF account balance
- You mentioned having $9 credit available
- Check Billing Settings for details
π Model Information
- Model: tencent/HunyuanImage-3.0
- Architecture: Autoregressive MoE (64 experts)
- Parameters: 80B total, 13B active per token
- License: tencent-hunyuan-community
- Paper: arXiv:2509.23951
π Links
π Citation
@article{cao2025hunyuanimage,
title={HunyuanImage 3.0 Technical Report},
author={Cao, Siyu and Chen, Hangting and others},
journal={arXiv preprint arXiv:2509.23951},
year={2025}
}