huggingface-lora-space-builder

Build and publish Gradio Hugging Face Spaces for image and video LoRA demos.

507|40|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/waybarrios/opencode-power-pack --skill huggingface-lora-space-builder-waybarrios
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: huggingface-lora-space-builder
Source: https://github.com/waybarrios/opencode-power-pack/tree/main/skills/huggingface-lora-space-builder
Command: npx skills add https://github.com/waybarrios/opencode-power-pack --skill huggingface-lora-space-builder-waybarrios

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gradio, diffusers, huggingface_hub, torch, spaces, transformers, accelerate, peft, safetensors, and includes references (resource) components.

What problem does it solve? Publishing a demo for a LoRA on Hugging Face Spaces requires picking the correct diffusers pipeline class, designing a UI matched to the LoRA's specific task, configuring ZeroGPU hardware, and debugging build failures — a multi-step process where small mistakes produce silently broken Spaces. ## Core Features & Use Cases - Pipeline Selection and Verification: Reads the LoRA's model card and the base model's own card to pick the correct diffusers pipeline class (e.g. QwenImageEditPipeline vs QwenImageEditPlusPipeline), avoiding wrong-class failures. - Task-Adapted UI Design: Designs Gradio interfaces from the LoRA's actual inputs — pose extraction previews, aspect-ratio pickers, brush canvases, or custom HTML/JS widgets — rather than generic templates. - ZeroGPU Publishing and Smoke-Testing: Writes app.py, requirements.txt, and README.md with correct ZeroGPU configuration, publishes a private Space, and verifies it end-to-end with gradio info and gradio predict. - Use Case: A user trained a relighting LoRA on Qwen-Image-Edit and wants a shareable browser demo; the skill reads the model card, builds a Space with an image upload and lighting controls, publishes it privately, and smoke-tests inference before sharing the URL. ## Quick Start Build and publish a Hugging Face Space demo for my LoRA at username/my-lora.

Frequently Asked Questions about huggingface-lora-space-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I publish a Hugging Face Space demo for my LoRA?▼

Provide the LoRA's Hub repo ID; the skill reads its model card, picks the correct diffusers pipeline, writes app.py, requirements.txt, and README.md, then publishes a private Space on ZeroGPU hardware. You review all three files in one batched approval before publishing.

How do I choose the right diffusers pipeline for a LoRA?▼

Read the base model's own model card and use the pipeline class imported in its diffusers snippet — it is the source of truth. Variants in the same family can differ, e.g. Qwen-Image-Edit uses QwenImageEditPipeline while the 2509/2511 variants use QwenImageEditPlusPipeline.

Does ZeroGPU require a Hugging Face PRO subscription?▼

Yes, ZeroGPU is available to PRO, Team, and Enterprise accounts. Free-tier users can still create the Space with hardware: zero-a10g in the README, but it falls back to CPU until they upgrade or receive a community GPU grant.

Why does my Space build succeed but produce wrong output?▼

The most common cause is loading the LoRA onto the wrong pipeline class or using the wrong weight_name in load_lora_weights. Verify the pipeline class against the base model card and check the actual safetensors filename with list_repo_files.

What should not go in requirements.txt for a Gradio Space?▼

Do not list gradio, torch, spaces, or huggingface_hub — they are provided by the Space runtime, and gradio's version is controlled by sdk_version in the README YAML. Also avoid xformers and flash-attn unless app.py actually uses them, since they frequently cause build conflicts.

When should a LoRA demo use custom HTML/JS instead of standard Gradio components?▼

Use custom HTML/JS via gr.HTML only when the LoRA's natural input shape — point sets, brush strokes, trajectories, 3D gizmos — fits neither stock Gradio components nor Hub custom components like gradio_image_annotation. Always try the simpler rungs first.