Giter Club home page Giter Club logo

dataset-webui's Introduction

LoRA Dataset Webui

This project aims to help with the creation and management of LoRa training datasets. Scroll down to the bottom of the page for a feature overview.

This is still in beta - please report any bugs you find Pull requests are welcome. Currently everything is just cobbled together

Roadmap:

  • Refractor tag management
  • Add single-image tag overrides [mostly done]
  • Add superresolution/upscaling for small images

Known issues:

  • No files/folders are ever deleted, leading to clutter/orphaned images
  • Deleting an enite folder can break the step
  • When an image is open and you save the dataset, it will throw an error and half of the files are left where they are.

Getting started

(optional) create a venv first:

python -m venv venv
venv\Scripts\activate

install the requirements:

pip install -r requirements.txt

start either by running start.bat or manually using:

python webserver.py

(see python webserver.py --help for launch arguments)

Access the webui on the following URL: http://127.0.0.1:8080/

If tagging/cropping/etc is too slow, try run pip install onnxruntime-gpu, but keep in mind that this will use some of your VRAM.

download-dependencies.py

Running this script is recommended to get all features of the webui.

using start.bat already downloads all dependencies by default

It will gives you the option to download the following files:

  • danbooru-tags.json and gelbooru-tags.json from github gist or catbox.moe.
    • You also have the option to scrape the tags from the site directly.
  • cropper.js and cropper.css from Cloudflare/cdnjs.

Updating

Clear your browser cache between updates. It tends to leave the old scripts/css loaded

Folder structure

The folders created are meant to be used as follows:

  • 0 - raw - raw images from the internet / screenshots
  • 1 - cropped - cropped images (1:1 aspect ratio)
  • 2 - sorted - images grouped by quality / topic / etc
  • 3 - tagged - .txt or .json files containing autotagger output
  • 4 - fixed - pruned tags in .txt format.
  • 5 - out - scaled down images and pruned tags - point your training script here
  • datasets - all your datasets are saved here

Features:

Some of these images/videos might be outdated. There's also in UI tooltips. If something breaks just open an issue here on Github.

Dataset manager

  • Save / load datasets you're working on
  • Avoid having to change training folder, just point your training script at the 5 - out folder and load the right dataset
  • Write notes for yourself

ui_dataset

Cropping

  • Crop images in your browser
  • Edit already cropped images
  • Duplicate image - crop two separate parts
  • Quickly set the cropped area, copy it from the previous image
  • Keyboard shortcuts
ui_crop.mp4

Auto cropping

  • This is a good "baseline" to work from
  • You can go back and quickly fix what it misses
  • It can detect multiple subjects.
autocrop.mp4

Sorting

  • add categories
  • quickly sort multiple images, captcha style
  • hit detection can be janky
ui_sort.mp4

Auto sorting

  • Don't want to do it manually? Set the tags and sort automatically.
ui_sorter.mp4

Tagging

CPU-only autotagger

  • A bit slow but does not take any vram, doesn't influence training.
  • The output isn't realtime, I think it can do about 1 image/sec on my 11gen i5
ui_tagger.mp4

Tag pruning

  • Prune useless tags from the autotagger
  • Normalize tags
  • Quickly blackist/whitelist tags
  • Replace tags on all images
  • Edit rules, test the effects

ui_tag_pruning

Output

  • Scale images to required training resolution

ui_output

dataset-webui's People

Contributors

city96 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dataset-webui's Issues

Larger cropping res?

I used your dataset manager to help make an SD1.5 lora. It was easy enough, but I have one request:

Is there any way to increase the cropping/upscaling resolution to 1024x1024?

I want to try training an SDXL lora, but I believe my dataset would have to be 1024x1024.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.