npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

civitai-to-hf

v1.0.0

Published

Download models from CivitAI and upload them to HuggingFace Hub as proper model repos

Downloads

52

Readme

civitai-to-hf

Download models from CivitAI and upload them to HuggingFace Hub as proper model repositories — complete with README, code snippets, sample images, and metadata.

Features

  • Works with any model type — LoRA, Checkpoints, Textual Inversion, VAE, ControlNet, and more
  • Auto-generates README — YAML frontmatter, diffusers code snippets, trigger words, example prompts
  • Downloads sample images — Extracts prompts, negative prompts, and generation parameters
  • Smart base model mapping — SD 1.5, SDXL, Flux, SD 3.5, Pony, and many more
  • NSFW-safe — All NSFW levels included by default
  • Streaming uploads — Large model files are uploaded efficiently without loading into memory

Installation

npm install -g civitai-to-hf

Or run directly with npx:

npx civitai-to-hf https://civitai.com/models/144684

Prerequisites

Set these environment variables:

| Variable | Required | Description | |----------|----------|-------------| | HF_TOKEN | Yes | HuggingFace write token (get one here) | | CIVITAI_API_KEY | No | CivitAI API key (needed for gated/restricted models) |

Usage

# Basic: download + upload
civitai-to-hf https://civitai.com/models/144684

# Specify exact HF repo name
civitai-to-hf https://civitai.com/models/144684 --hf-repo myuser/my-sweet-lora

# Private repo
civitai-to-hf https://civitai.com/models/144684 --private

# Download only (skip HF upload)
civitai-to-hf https://civitai.com/models/144684 --no-upload --download-dir ./my-model

# Specify a particular version
civitai-to-hf "https://civitai.com/models/144684?modelVersionId=123456"

All Options

| Option | Description | |--------|-------------| | --hf-repo <repo> | Target HuggingFace repo ID (auto-generated by default) | | --private | Make the HF repo private (default: public) | | --civitai-key <key> | CivitAI API key (default: CIVITAI_API_KEY env) | | --hf-token <token> | HuggingFace write token (default: HF_TOKEN env) | | --download-dir <dir> | Local directory to save files (default: temp dir) | | --no-upload | Download only, skip HuggingFace upload | | --max-images <n> | Maximum sample images to download (default: 20) |

Input Formats

The tool accepts many input styles:

https://civitai.com/models/144684              # Model page URL
https://civitai.com/models/144684?modelVersionId=123456  # Specific version
https://civitai.red/models/1120962              # Mirror URL
https://civitai.com/api/download/models/28907   # Download API URL
144684                                          # Plain model ID

What It Does

  1. Fetches metadata from CivitAI REST API
  2. Selects version — latest or specific
  3. Downloads model file — primary .safetensors + any additional files
  4. Downloads sample images — up to --max-images with generation metadata
  5. Generates README.md — with YAML frontmatter, description, trigger words, and diffusers code
  6. Saves metadatacivitai_metadata.json with full source info
  7. Creates HF repo — public or private
  8. Uploads everything — single batch upload via streaming

Supported Model Types

| CivitAI Type | HF Repo Type | |---|---| | Checkpoint, LoRA, LoCon, DoRA, VAE, ControlNet, TextualInversion, Hypernetwork, Upscaler, MotionModule | model | | Wildcards, Workflows | dataset |

License

MIT