Skip to main content
Version: v2

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 prompt and negative_prompt appropriate 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 the prompt and negative_prompt fields. If the prompt or negative_prompt fields do not exist in the JSON, they are created automatically.
  • 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 the apiname key.
  • 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 disable negative_prompt, write "negative_prompt": "delete" in the JSON.

Configuration Examples​

black-forest-labs/FLUX.2-klein-4B

Space

{
"width": 1024,
"height": 1024
}

hugging-apps/anima-light-lavender-demo

Space

{
"image_description": "{prompt}",
"negative_prompt": "{negative_prompt}",
"width": 1152,
"height": 1152
}

lehehroi/Illustrious130

Space

{
"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

Space

{
"apiname": "/generate_image",
"width": 1152,
"height": 1152
}

Troubleshooting​

403 Error on Connection Test​

  • The token requires Inference and Read billing usage and payment method status permissions.