Hugging Face
Use public or private image generation Spaces on the Hugging Face Hub.
Setup Requirements
- Space ID: Find the ID of the Space you want to use. The format is
organization/space-name(e.g.,stabilityai/stable-diffusion-3-medium). - Token (Optional): If the Space is private or requires login, you must provide a Hugging Face user access token. You can create one in your Hugging Face account settings.
Parameter Customization
- Parameters can be configured by writing them in JSON format. The app automatically inserts
promptandnegative_promptappropriate for the story.- Placeholder strings
{prompt}and{negative_prompt}in the JSON are replaced with prompts by the app. If these placeholders are not present in the JSON, the prompts are prepended to the values of thepromptandnegative_promptfields. If thepromptornegative_promptfields do not exist in the JSON, they are created automatically.
- Placeholder strings
- Any additional required parameters not specified will use the Space's default values.
- Any specified parameters not needed by the Space are automatically removed.
- If the Space does not have an API named
/infer, a similar API name is applied automatically. You can manually specify it by entering the API name in theapinamekey. - The following is a legacy specification but still works.
- Some models may not work if unnecessary parameters are present. In such cases, you can disable a parameter by setting its value to
delete. For example, to disablenegative_prompt, write"negative_prompt": "delete"in the JSON.
- Some models may not work if unnecessary parameters are present. In such cases, you can disable a parameter by setting its value to
Configuration Examples
black-forest-labs/FLUX.2-klein-4B
{
"width": 1024,
"height": 1024
}
hugging-apps/anima-light-lavender-demo
{
"image_description": "{prompt}",
"negative_prompt": "{negative_prompt}",
"width": 1152,
"height": 1152
}
lehehroi/Illustrious130
{
"width": 1152,
"height": 1152,
"prompt": "best quality",
"negative_prompt": "monochrome, (low quality, worst quality:1.2), very displeasing, 3d, watermark, signature, ugly, poorly drawn,"
}
mrfakename/Z-Image-Turbo
{
"apiname": "/generate_image",
"width": 1152,
"height": 1152
}
Troubleshooting
403 Error on Connection Test
- The token requires Inference and
Read billing usage and payment method statuspermissions.