Coder Social home page Coder Social logo

crosstyan / birme-sd-variant Goto Github PK

View Code? Open in Web Editor NEW

This project forked from livelifebythecode/birme-sd-variant

1.0 0.0 0.0 1.07 MB

Exact clone of the beautiful https://www.birme.net/ with additional image quality config

License: Other

JavaScript 14.93% CSS 79.27% HTML 5.79%

birme-sd-variant's Introduction

-> Demo Site <-

Birme Variant for Stable Diffusion

When training Stable Diffusion (or other generative image models) we need high quality and cropped training images at 512x512. Birme is the best tool for doing this quickly, and with the help of smartcrop.js it's truly a powerful tool for batch cropping images.

Local Install

Clone the repository and open index.html in your favorite browser (excluding Firefox). Feel free to bookmark!

git clone https://github.com/livelifebythecode/birme-sd-variant.git
cd birme-sd-variant
python -m webbrowser index.html  # or simply open the index.html file

Problem

Birme restricts the users ability to choose what smoothing is applied which can result in a lower quality cropped image.

In the Birme code, notice the line con.imageSmoothingQuality = "medium"; harcodes the smoothing quality when we crop the image.

process_image(img, file) {
    ...
    let canvas = document.createElement("canvas");
    canvas.width = tw;
    canvas.height = th;
    let con = canvas.getContext("2d");
    con.imageSmoothingEnabled = true;
    con.imageSmoothingQuality = "medium";
    ...
}

(sourced on 10-14-22: line #627)

Solution

Select the desired smoothing quality in the "Image Format / Quality" settings Image of the Quality Preset dropdown box in the "Image Format / Quality settings

Results

TODO: Show comparison of 'Medium', 'High', and 'Hermite' quality presets High works better on landscape/subjects typically, where as Medium is better at smoothing close up text.

Limitations

Authors

Extra

The Hermite quality option uses the Hermite resize library so you can experiment with what gives you the best quality image for your source images.

birme-sd-variant's People

Contributors

livelifebythecode avatar

Stargazers

 avatar

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.