| name | huggingface-lora-space-builder |
| description | Publishes a Gradio Hugging Face Space that runs inference with a user-provided LoRA on ZeroGPU (diffusers pipelines for Qwen-Image, LTX, FLUX, SDXL, and similar). Use when the user wants a browser demo or playground for a LoRA. Not for training LoRAs, local Diffusers scripts (stable-diffusion), or ComfyUI graphs (comfyui). |
| version | 1.0.1 |
| risk | unknown |
| source | https://github.com/huggingface/skills/tree/main/skills/huggingface-lora-space-builder |
| source_repo | huggingface/skills |
| source_type | official |
| date_added | 2026-07-01T00:00:00.000Z |
| license | Apache-2.0 |
| license_source | https://github.com/huggingface/skills/blob/main/LICENSE |
Gradio LoRA Space Builder
When to Use
Use this skill when you need to build and publish a Gradio demo on Hugging Face Spaces that runs inference with a user-provided LoRA. Use whenever someone asks to create, generate, ship, or publish "a Space", "a demo", "a Gradio app", or "a playground" for a LoRA — whether the base model is Qwen-Image, Qwen-Image-Edit, LTX, Wan, FLUX, SDXL, or another diffusion model. The default target is ZeroGPU hardware and the default inference library is diffusers when the base model supports it.
The output is a real, published Space (private by default) that the user can try in the browser, not a local script.
Prerequisites
- A Hugging Face account.
- A Hugging Face access token with write scope (to read the LoRA if it's private/gated, and to publish the Space). Create one at
https://huggingface.co/settings/tokens.
- Python environment with
huggingface_hub, gradio, and diffusers installed for local smoke-testing.
Procedure
Work through these phases in order. Information gathered in one phase decides the next. Don't drip-feed questions across multiple turns; batch them.
Phase 1: Gather LoRA Info
- Check for cached token first. Do not immediately ask for a token. Check if the user is already authenticated.
from huggingface_hub import HfApi, get_token
cached_token = get_token()
if cached_token:
try:
info = HfApi().whoami(token=cached_token)
username = info["name"]
except Exception:
cached_token = None
- Ask for token only if needed. If no cached token exists or it can't read a private repo, ask once: "I need a Hugging Face access token with write scope (to read the LoRA if it's private/gated, and to publish the Space). Create one at https://huggingface.co/settings/tokens. Paste it here."
- Read the LoRA repo. List files (
HfApi().list_repo_files(repo_id)) and fetch the model card (ModelCard.load(repo_id)).