huggingface-lora-space-builder
Ce qu’il fait
Cette compétence crée une démonstration dans le navigateur pour un LoRA, un petit module complémentaire qui personnalise un modèle d'image ou de vidéo. Elle s'adresse aux créateurs qui ont entraîné ou hébergent un LoRA et veulent partager une démonstration fonctionnelle.
Quand l’utiliser
- ✓Quand vous voulez publier un Space ou une démonstration pour un modèle LoRA.
- ✓Quand vous avez entraîné un LoRA et voulez le partager sous forme d'espace de test interactif.
- ✓Quand vous voulez une démonstration pour un modèle de diffusion comme FLUX, SDXL ou Wan avec un LoRA.
Lien du skill
https://github.com/huggingface/skills/blob/main/skills/huggingface-lora-space-builder/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Publie un Space qui permet aux gens d'essayer mon LoRA pour les photos de produits sur FLUX, avec une simple zone de saisie de prompt.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
L'IA conçoit une démonstration avec seulement les commandes nécessaires au LoRA, puis l'écrit et la publie comme application Gradio sur Hugging Face Spaces. Le Space est privé par défaut, donc vous décidez quand le partager.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
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.
- Gather the LoRA info needed to pick a pipeline and design a UI.
- Pick the base pipeline and inference recipe.
- Design the UI for this specific LoRA's task and inputs.
- Write
app.py,requirements.txt, andREADME.mdtogether; show all three to the user for one batched approval. - 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.
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-grained token scope info if applicable
except Exception:
cached_token = None # token exists but is invalid/expired
Then:
- If a valid cached token exists and it can read the repo, use it. No prompt needed.
- If no cached token, or the cached token can't read this private repo, ask the user for a token — once, with the explanation below.
When asking for a token (and only when you actually need to ask):
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.
The same token will be reused for publishing in the final phase, so this is a one-time ask.
Then read what's in the repo:
- List the repo files (
huggingface_hub.HfApi().list_repo_files(repo_id)). Look for.safetensors,README.md, example images/videos, multiple checkpoints. - Fetch the model card (
huggingface_hub.ModelCard.load(repo_id)). Thedatadict has structured fields; thetexthas the README body. - If multiple
.safetensorsfiles exist, pick the right one — see "Picking the LoRA weights file" inreferences/zerogpu-and-publishing.md. Briefly: README-recommended file wins, thenpytorch_lora_weights.safetensors, then latest training checkpoint, otherwise ask.
From the model card, try to determine:
- Base model — the
base_modelfield, or text mentions in the README. Usually present. Use it to pick the pipeline reference file (see P
Questions fréquentes
Le Space est-il public ?
Il est privé par défaut, pour que vous puissiez le vérifier avant de le partager.
Quel matériel utilise-t-il ?
La cible par défaut est le matériel ZeroGPU, et la compétence utilise diffusers lorsque le modèle de base le permet.
Fonctionne-t-elle uniquement pour les modèles d'image ?
Non. La compétence couvre aussi les modèles de diffusion vidéo comme LTX et Wan.
Détails
Description originale de l’auteur
Build and publish a Gradio demo on Hugging Face Spaces for a user-provided LoRA. Use when someone asks to create, generate, ship, or publish a Space, demo, Gradio app, or playground for a LoRA — including LoRAs for Qwen-Image, Qwen-Image-Edit, LTX-Video, Wan, FLUX, SDXL, or other diffusion base models. Also triggers when someone describes a LoRA they trained or hosts on the Hub and wants to share it. Covers picking the right base pipeline and `diffusers` inference recipe, designing a UI tailored to the LoRA's task and inputs (Union/multi-task control, edit, video, image, etc.), respecting mode
repo: huggingface/skills
Popularité
- Étoiles GitHub
- 11k
- Position au classement
- #11775
- Licence
- Apache-2.0
- Mis à jour
- 30/10/2026
Commentaires
- …
Autres skills de ce dépôt
hf-cli
11kAide votre agent à utiliser l'outil en ligne de commande Hugging Face pour télécharger, téléverser et gérer des modèles, jeux de données, Spaces, dépôts et le cache local.
hf-cloud-aws-context-discovery
11kAide votre agent à trouver votre profil AWS, votre région et les détails de votre compte avant tout travail cloud, pour qu'il ne devine pas quel compte utiliser.
hf-cloud-python-env-setup
11kAide votre agent à mettre en place un environnement Python propre, avec une version adaptée et des bibliothèques à jour, avant d'exécuter SageMaker ou des automatisations AWS.
hf-cloud-sagemaker-deployment-planner
11kAide votre agent à planifier le déploiement d'un modèle sur Amazon SageMaker, en choisissant un hébergement en temps réel, sans serveur, asynchrone ou par lots, avec des valeurs par défaut raisonnables.
Skills similaires
pytorch-patterns
280kAide votre agent à utiliser PyTorch pour les modèles de machine learning. Il applique les bonnes pratiques pour un entraînement efficace et des résultats reproductibles.
evm-token-decimals
280kAide votre agent à éviter les erreurs de nombres décimaux sur différents réseaux blockchain. Il garantit des valeurs de tokens exactes dans les transactions et les calculs.
ito-inference
280kPermet à votre agent de vérifier la disponibilité des modèles d'IA. Il relie la demande de calcul au service de modèle prêt à l'emploi.