Coder Social home page Coder Social logo

journeyworker / dreamartist-sd-webui-extension Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jjtolton/dreamartist-sd-webui-extension

0.0 0.0 0.0 59.59 MB

DreamArtist for Stable-Diffusion-webui extension

License: Apache License 2.0

JavaScript 1.38% Python 98.51% CSS 0.11%

dreamartist-sd-webui-extension's Introduction

DreamArtist (webui Eextension)

Paper: arXiv

This repo is the official *Stable-Diffusion-webui extension version implementation of "DreamArtist: Towards Controllable One-Shot Text-to-Image Generation via Contrastive Prompt-Tuning" with Stable-Diffusion-webui.

Standalone version: DreamArtist

Everyone is an artist. Rome wasn't built in a day, but your artist dreams can be!

With just one training image DreamArtist learns the content and style in it, generating diverse high-quality images with high controllability. Embeddings of DreamArtist can be easily combined with additional descriptions, as well as two learned embeddings.

Setup and Running

Clone this repo to extension folder.

git clone https://github.com/7eu7d7/DreamArtist-sd-webui-extension.git extensions/DreamArtist

Training and Usage

First create the positive and negative embeddings in DreamArtist Create Embedding Tab.

Preview Setting

After that, the names of the positive and negative embedding ({name} and {name}-neg) should be filled into the txt2img Tab with some common descriptions. This will ensure a correct preview image.

Train

Then, select positive embedding and set the parameters and image folder path in the DreamArtist Train Tab to start training. The corresponding negative embedding is loaded automatically. If your VRAM is low or you want save time, you can uncheck the reconstruction.

Recommended parameters

better to train without filewords

Remember to check the option below, otherwise the preview is wrong.

Inference

Fill the trained positive and negative embedding into txt2img to generate with DreamArtist prompt.

Attention Mask

Attention Mask can strengthen or weaken the learning intensity of some local areas. Attention Mask is a grayscale image whose grayscale values are related to the learning intensity show in the following table.

grayscale 0% 25% 50% 75% 100%
intensity 0% 50% 100% 300% 500%

The Attention Mask is in the same folder as the training image and its name is the name of the training image + "_att". You can choose whether to enable Attention Mask for training.

Since there is a self-attention operation in VAE, it may change the distribution of features. In the Process Att-Map tab, it can superimpose the attention map of self-attention on the original Att-Map.

Dynamic CFG

Dynamic CFG can improve the performance, especially when the data set is large (>20). For example, linearly from 1.5 to 3.0 (1.5-3.0), or with a 0-ฯ€/2 cycle of cosine (1.5-3.0:cos), or with a -ฯ€/2-0 cycle of cosine (1.5-3.0:cos2). Or you can also customize non-linear functions, such as 2.5-3.5:torch.sqrt(rate), where rate is a variable from 0-1.

Tested models (need ema version):

  • Stable Diffusion v1.4
  • Stable Diffusion v1.5
  • animefull-latest
  • Anything v3.0
  • momoko-e

Embeddings can be transferred between different models of the same dataset.

Pre-trained embeddings:

Download

Name Model Image embedding length
(Positive, Negative)
iter lr cfg scale
ani-nahida animefull-latest 3, 6 8000 0.0025 3
ani-cocomi animefull-latest 3, 6 8000 0.0025 3
ani-gura animefull-latest 3, 6 12000 0.0025 3
ani-g animefull-latest 3, 10 1500 0.003 5
asty-bk animefull-latest 3, 6 5000 0.003 3
asty-gc animefull-latest 3, 10 1000 0.005 5
real-dog sd v1.4 3, 3 1000 0.005 5
real-sship sd v1.4 3, 3 3000 0.003 5
sty-cyber sd v1.4 3, 5 15000 0.0025 5
sty-shuimo sd v1.4 3, 5 15000 0.0025 5

Style Clone

Prompt Compositions

Comparison on One-Shot Learning

Other Results

dreamartist-sd-webui-extension's People

Contributors

irisrainbowneko avatar jjtolton avatar omegastick 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.