loras_tools / README.md
waveshaker's picture
Update README.md
465bfb0 verified
|
Raw History Blame Contribute Delete
7.76 kB
---
license: mit
tags:
- lora
- tool
- python
- gui
pipeline_tag: text-to-image
---
> **Note:** This repository hosts management scripts/tools only. No model weights are included.
---
### Tools for:
🖼️ <a href="https://huggingface.co/spaces/waveshaker/loras_gallery" target="_blank">**waveshaker/loras_gallery**</a>
🧊 <a href="https://huggingface.co/waveshaker/loras" target="_blank">**waveshaker/loras**</a>
📊 <a href="https://huggingface.co/datasets/waveshaker/dataset_collections" target="_blank">**waveshaker/dataset_collections**</a>
📦 <a href="https://huggingface.co/waveshaker/comfy_models" target="_blank">**waveshaker/comfy_models**</a>
🧠 <a href="https://huggingface.co/spaces/waveshaker/universal-lora-studio" target="_blank">**waveshaker/universal-lora-studio**</a>
---
- <details>
<summary><code>models_manager_v*.py</code> is used for centralized local management of <code>waveshaker/loras_gallery</code> | <code>waveshaker/loras</code> | <code>waveshaker/dataset_collection</code>: (Click to expand)</summary>
Features:
1. **JSON Management**: Pull/upload `waveshaker/loras_gallery/models.json`, maintain card metadata (Title, Trigger, Dataset URL, Showcase URL, Update Time in Unix timestamp), and globally manage custom KV fields. Supports both full-prefix JSON (for local editing) and clean relative-path JSON (for minimal cloud uploads).
2. **Model Upload**: Auto-clean local images and convert them to WebP, then upload the `.safetensors` and `.webp` files to the `waveshaker/loras` Model repo. Automatically appends new model entries with an `update_time` timestamp and updates the minimal cloud `waveshaker/loras_gallery/models.json`.
3. **Dataset Upload**: Automated pipeline (TXT cleanup, PNG to JPG, Parquet packaging) and push to the `waveshaker/dataset_collections` Dataset repo.
4. **Showcase Upload**: Process local PNGs (extract metadata, convert to WebP), generate/update `gallery.json`, and push to the `waveshaker/loras/comfyui_showcase` folder in the Models repo. Supports both local-only generation and incremental upload.
![MainPage](https://huggingface.co/waveshaker/loras_tools/resolve/main/preview/preview1.webp)
</details>
- <details>
<summary><code>base_model_uploader_gui.py</code> is a GUI tool for batch uploading base models and cloning remote repos to <code>waveshaker/comfy_models</code> (Click to expand)</summary>
Features:
- Streamlines batch uploading of large `.safetensors` files. It supports multi-threaded transfers, auto-resumption, and status tracking to skip completed files.
- Enables instant server-side duplication of remote HuggingFace models via URL without downloading.
</details>
- <details>
<summary><code>comfy_dataset_prep_wf_v**.json</code>: A ComfyUI workflow for LoRA dataset prep. (Click to expand)</summary>
Integrates Krea2, Qwen Image 2.1, Flux 2 Klein 9B, and [SQVLM](https://github.com/KLL535/ComfyUI_Simple_Qwen3-VL-gguf/tree/main) for high-res(1-1.56MP) upscaling and auto-captioning of faces and bodies.
my LLM settings in `system_prompts_user.json` in `ComfyUI\custom_nodes\ComfyUI_Simple_Qwen3-VL-gguf`(aka SQVLM):
```
"📄🖼️🎬Qwen3.8-27B-Uncensored-HauhauCS-Aggressive.IQ3_XS": {
"model_path": "G:\\StableDiffusion\\MODELS\\LLM\\GGUF\\Qwen3.8-27B-Uncensored-HauhauCS-Aggressive.IQ3_XS.gguf",
"mmproj_path": "G:\\StableDiffusion\\MODELS\\LLM\\GGUF\\Qwen3.8-27B-Uncensored-HauhauCS-Aggressive.mmproj-BF16.gguf",
"max_tokens": 4096,
"max_frames": 81,
"image_min_tokens": 128,
"image_max_tokens": 1024,
"n_ctx": 102400,
"n_batch": 2048,
"n_ubatch": 512,
"enable_thinking": false,
"n_keep": 512,
"n_gpu_layers": -1,
"n_threads": 8,
"use_mmap": true,
"split_mode": 0,
"temperature": 0.8,
"top_p": 0.95,
"min_p": 0.05,
"repeat_penalty": 1.1,
"presence_penalty": 0.0,
"top_k": 40,
"chat_handler": "qwen35",
"script": "qwen3vl_run.py",
"debug": true,
"verbose": false
},
```
</details>
- <details>
<summary><code>showcase_tempalte_v**.json</code>: A ComfyUI workflow designed to generate PNG images with embedded workflow metadata. (Click to expand)</summary>
The accompanying Python tool `models_manager_v*.py` parses these images to extract the exact Prompt, generation parameters, and LoRA stacks, automatically compiling them into a structured `gallery.json` for the web gallery's "ComfyUI Showcase" viewer.
Wildcards used in workflow:
- [SFW Wildcards 1 DL](https://civitai.com/models/2231696)
- [SFw Wildcards 2 DL](https://civitai.com/models/2765483/bunnys-sfw-wildcards-or-lora-friendly-or-16582-prompts-or-565m-tokens)
</details>
- `filter_nsfw.py`: A script for rough NSFW filtering(based on NudeNet). It provides a quick initial screen, but manual review is still necessary for accurate results.
- <details>
<summary><code>batch_preview_generator/</code>: A 5-steps batch pipeline for auto-generating and deploying showcase preview images. (Click to expand)</summary>
It follows a structured 5-step workflow:
1. Uses `0_batch_template_*.json` to batch generate random preview images.
2. Runs `1_batch_regroup.py` to automatically reorganize all output images into their respective subfolders.
3. Runs `2_batch_process_meta.py` to extract the `meta` data from the `png` files and convert the images into `webp` format.
4. Runs `3_batch_upload_showcase.py` to batch upload the processed showcase folders to Hugging Face.
5. Runs `4_batch_modify_json.py` to automatically update the `models.json` data by regex-matching the `showcase` items for each entry, leaving you ready for a final manual upload.
</details>
<p style="font-size: 0.85em;"><em>The <code style="font-size: 0.85em;">batch_preview_generator/</code> is primarily designed for adapting older models like <strong style="font-size: 0.85em;">Pony</strong> and <strong style="font-size: 0.85em;">FLUX.1 - Dev</strong>, with the main goal of rapid batch generation. For newer models, use <code style="font-size: 0.85em;">showcase_tempalte_v**.json</code> to generate images, and then upload them using <code style="font-size: 0.75em;">models_manager_v*.py</code>.</em></p>
- `hf_space_cap_checker.py`: Compares and calculates the total storage size of models defined in `waveshaker/comfy_models/studio_config.json` and `waveshaker/universal-lora-studio/model_config.py`. Filters duplicates via the HF API to ensure the total size does not exceed Hugging Face's 150 GB capacity limit.
- <details>
<summary><code>checkpoint_splitter/</code>: Utilities to split AIO checkpoints into VAE, TE, and UNET, including UNET int8 quantization and checkpoint re-merging. (Click to expand)</summary>
- `check_keys.py`: Inspects the keys of split safetensors files to verify and adjust split logic.
- `checkpoint_int8_convrot.py`: Uses Kijai's `quant_int8_convrot.py` to quantize the UNET of an AIO checkpoint to int8 convrot, without altering the Text Encoder (TE) or VAE.
- `split_checkpoint_Illustrious.py`: Extracts the VAE, TE, and UNET from Illustrious checkpoints.
- `split_checkpoint_pony.py`: Extracts the VAE, TE, and UNET from Pony checkpoints.
- `split_checkpoint_sd15.py`: Extracts the VAE, TE, and UNET from SD 1.5 checkpoints.
- `split_checkpoint_sdxl.py`: Extracts the VAE, TE, and UNET from SDXL checkpoints.
</details>
---