huggingface-lora-space-builder
🤖 AI Summary
This skill takes a user-provided LoRA (from Hugging Face Hub or training output) and automatically builds, configures, and publishes a private Gradio Space on Hugging Face that runs inference with it, targeting ZeroGPU hardware and using `diffusers` by default.
How to Install
Claude Code:
git clone --depth 1 https://github.com/huggingface/skills.git && cp skills/skills/huggingface-lora-space-builder ~/.claude/skills/huggingface-lora-space-builder -r# Gradio LoRA Space Builder
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, or another diffusion model. Also use when someone describes a LoRA they trained or hosts on the Hub and wants to share it. 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.
## What "good" looks like for these demos
The demo should feel handcrafted for this specific LoRA, not a generic template with the LoRA bolted on. Two LoRAs that share a task can still need different demos: a pose-control video LoRA and an outpainting video LoRA both take video in and produce video out, but the inputs the user provides, the preprocessing, and the controls are completely different. Recognizing that is the central job here.
Concretely, a good demo:
- Loads fast and runs fast — minimal model loading, sensible step count, no wasted computation per call.
- Has a UI with exactly the controls this LoRA needs and nothing else. Excess sliders are a cost, not a feature.
- Shows the user what's happening — progress, intermediate outputs where useful, the seed used, a clear error when input is missing.
- Honors the LoRA's own recommendations from its model card: trigger words, recommended step count, recommended guidance scale, recommended LoRA scale, example inputs.
- Is creative where creativity helps — interactive canvases, before/after sliders, side-by-side previews of intermediate processing — and plain where plainness is right.
## Workflow
Work through these phases in order. Information gathered in one phase decides the next.
1. Gather the LoRA info needed to pick a pipeline and design a UI.
2. Pick the base pipeline and inference recipe.
3. Design the UI for this specific LoRA's task and inputs.
4. Write `app.py`, `requirements.txt`, and `README.md` together; show all three to the user for one batched approval.
5. Publish the Space (private).
Don't drip-feed questions across multiple turns. Batch them.
---
## Phase 1 — Gather LoRA info
Required: a LoRA repo on the Hub (e.g. `username/my-lora`).
**First, try to read the repo without a token.** If it succeeds, the repo is public — proceed. If it fails with 401/403, the repo is private/gated and you need an authenticated session to read it. **Don't immediately ask for a token.** Check first whether the user is already authenticated.
```python
from huggingface_hub import HfApi, get_token
cached_token = get_token() # picks up HF_TOKEN env var or cached CLI login
if cached_token:
try:
info = HfApi().whoami(token=cached_token)
username = info["name"]
# info also has fine-graine
Details
| Category | AI/ML → ml |
| Source | huggingface/skills |
| SKILL.md | View on GitHub → |
| Repo Stars | ★ 10.7K |
| Est. per Skill | 357 (shared across 30 skills from this repo) |
| Difficulty | Intermediate |
| Risk Level | N/A |
Related Skills
ai-product
AI Product Development Every product will be AI-powered. The question is whether you'll build it rig
agentfolio
AgentFolio Role: Autonomous Agent Discovery Guide Use this skill when you want to discover, compare,
onboarding-psychologist
You are a Behavioral Psychologist specializing in habit formation and user retention. Your task is t
marketing-psychology
Marketing Psychology & Mental Models (Applied · Ethical · Prioritized) You are a marketing psych
Works Well With
Skills from the same repository — often designed to work together
hf-mem
hfmem estimates the required memory for inference, including model weights and an optional KV cache,
hf-cli
Install: curl -LsSf https://hf.co/cli/install.sh | bash -s. The Hugging Face Hub CLI tool hf is avai
trl-training
TRL Training Skill You are an expert at using the TRL (Transformers Reinforcement Learning) library