huggingface-lora-space-builder
Fungsinya
Skill ini membangun demo browser untuk LoRA, yaitu tambahan kecil yang menyesuaikan model gambar atau video. Skill ini ditujukan untuk kreator yang melatih atau menjalankan LoRA dan ingin membagikan demo yang berfungsi.
Kapan dipakai
- βSaat Anda ingin Space atau demo dipublikasikan untuk model LoRA.
- βSaat Anda melatih LoRA dan ingin membagikannya sebagai playground interaktif.
- βSaat Anda menginginkan demo untuk model difusi seperti FLUX, SDXL atau Wan dengan LoRA.
Link skill
https://github.com/huggingface/skills/blob/main/skills/huggingface-lora-space-builder/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βPublikasikan Space yang memungkinkan orang mencoba LoRA saya untuk foto produk di FLUX, dengan kotak prompt sederhana.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
AI merancang demo hanya dengan kontrol yang dibutuhkan LoRA, lalu menulis dan mempublikasikannya sebagai aplikasi Gradio di Hugging Face Spaces. Space bersifat privat secara default, sehingga Anda yang memutuskan kapan membagikannya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apakah Space bersifat publik?
Space bersifat privat secara default, sehingga Anda bisa meninjaunya sebelum dibagikan.
Perangkat keras apa yang dipakai?
Target default adalah perangkat keras ZeroGPU, dan skill memakai diffusers jika model dasarnya mendukungnya.
Apakah hanya berfungsi untuk model gambar?
Tidak. Skill juga mencakup model difusi video seperti LTX dan Wan.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 11k
- Peringkat
- #11775
- Lisensi
- Apache-2.0
- Diperbarui
- 30/10/2026
Komentar
- β¦
Skill lain dari repositori ini
hf-cli
11kMembantu agent Anda memakai alat baris perintah Hugging Face untuk mengunduh, mengunggah dan mengelola model, dataset, Space, repositori serta cache lokal.
hf-cloud-aws-context-discovery
11kMembantu agent Anda menemukan profil, wilayah dan detail akun AWS Anda sebelum pekerjaan cloud apa pun, sehingga agent tidak menebak akun mana yang harus dipakai.
hf-cloud-python-env-setup
11kMembantu agent Anda menyiapkan lingkungan Python yang bersih dengan versi Python yang sesuai dan pustaka terbaru, sebelum menjalankan SageMaker atau otomatisasi AWS.
hf-cloud-sagemaker-deployment-planner
11kMembantu agent Anda merencanakan cara men-deploy model ke Amazon SageMaker, memilih hosting real-time, serverless, async atau batch dengan default yang masuk akal.
Skill serupa
pytorch-patterns
280kMembantu agent Anda menggunakan PyTorch untuk model machine learning. Menerapkan praktik terbaik untuk pelatihan model yang efisien dan hasil yang dapat direproduksi.
evm-token-decimals
280kMembantu agent menghindari kesalahan angka desimal di berbagai jaringan blockchain. Memastikan nilai token akurat dalam transaksi dan perhitungan.
ito-inference
280kMemungkinkan agent Anda mengecek ketersediaan model AI untuk digunakan. Menghubungkan permintaan komputasi dengan layanan model yang siap.