Giter VIP home page Giter VIP logo

finetune_stablediffusion_anime's Introduction

Naruto | LoRA:

Our Model is designed to create Naruto Animation characters from text-to-images and image-to-image using Low-Rank Adaption(LoRA) Stable Diffusion. You can download model from civitai here

Pre-trained Model

In our project, we employ a pre-trained model known as "Stable Diffusion." This model has undergone training on a massive dataset consisting of 5 billion text-to-image pairs, making it a powerful foundation for various image generation tasks.

  • Version: Stable Diffusion 1.5
  • Additional Features: We use "Low Rank Adaption (LoRA)" for enhanced performance. LoRA allows the model to be trained effectively with minimal training data and a small .safetensors file, unlike models that require gigabytes of data.

Fine Tune Dataset

Our dataset is derived from the popular Japanese anime, "Naruto Shippuden," and comprises approximately 1600 images, including fan art. You have the flexibility to use your dataset, but it must adhere to the proper format as outlined in the notebook.

  • Note: If your dataset contains fewer than 20 images, consider enabling the "flip augmentation" feature.

For more details, please refer to the Stable Diffusion Guide.

Trainer Extras

Our project offers various trainer extras, including hyperparameters that influence the training process:

  • Number of repeats: Determine how many times you want to repeat your images.
  • Number of epochs: Control the number of training epochs.
  • Train Batch Size: Adjust the batch size for training.

Learning Rates

  • UNet Learning Rate: This parameter governs how fast your LoRA model absorbs information. Setting it too small may result in slow learning, while setting it too large may lead to overfitting. We recommend using a learning rate in the range of 1e-4 to 2e-4, with 5e-4 as a default value, for most situations.

  • Text Encoder Learning Rate: While less critical, the text encoder learning rate aids in learning tags better. A good range for this parameter is between 1e-4 and 5e-5, typically being half or a fifth of the UNet learning rate.

  • Scheduler: The scheduler guides the learning rate over time. We suggest using the cosine scheduler with 3 restarts for optimal performance. You can experiment with other scheduler options, such as constant or constant with warmup, to fine-tune your training process. A warmup ratio of 5% is a recommended default.

Inference

To obtain inference from our project, follow these steps:

  1. Run the first cell; it will take some time. When you see "Model loaded in 32.4s...", interrupt it.
  2. Connect your Google Drive.
  3. Provide the path to your LoRA model.
  4. Run the last cell and open the Gradio link to interact with the model.

Check out a demo of the model trained on Naruto Anime Data Demo.

Feel free to explore and experiment with our project. If you have any questions or feedback, please don't hesitate to reach out.

You can find deployed model here

finetune_stablediffusion_anime's People

Contributors

huzaifaalihpc 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.