• Stars
    star
    694
  • Rank 65,170 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 2 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DreamArtist for Stable-Diffusion-webui extension

DreamArtist++

DreamArtist++ for training lora with just one image has been released, try it now:

HCP-Diffusion

All future updates of the DreamArtist series will be released in this new framework.

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

More Repositories

1

genshin_auto_fish

基于深度强化学习的原神自动钓鱼AI
Python
4,762
star
2

HCP-Diffusion

A universal Stable-Diffusion toolbox
Python
894
star
3

DreamArtist-stable-diffusion

stable diffusion webui with contrastive prompt tuning
Python
876
star
4

pixiv_AI_crawler

基于深度学习的p站高质量涩图AI爬虫,可以学会你的XP
Python
622
star
5

genshin_autoplay_domain

原神全自动刷秘境AI
Python
479
star
6

genshin_voice_play

语音控制玩原神
Python
141
star
7

HCP-Diffusion-webui

webui for HCP-Diffusion
Vue
139
star
8

ML-Danbooru

Anime image tags detector
Python
73
star
9

RobustDet

The official PyTorch implementation of "Adversarially-Aware Robust Object Detector"
Python
56
star
10

ML-Danbooru-webui

webui extension of ML-Danbooru
Python
53
star
11

GenshinMidi

根据midi自动生成原神音游谱
Python
48
star
12

yuanshen_auto_music

原神自动演奏脚本
Python
40
star
13

TeyvatOCR

识别并翻译原神中的提瓦特通用文
Python
27
star
14

anime-ai-detect-fucker

针对AI画图识别AI的对抗攻击
Python
25
star
15

synthesis_watermelon

基于box2d物理引擎的安卓版合成大西瓜
Java
15
star
16

yuanshen_draw

在原神中使用围栏绘图
Python
13
star
17

genshin_maze

AI自动生成并摆放原神迷宫
Python
7
star
18

torch-analyzer

A torch model analyzer
Python
7
star
19

open_cumputer

利用esp8266+舵机实现远程开机,包含服务器端代码实现内网穿透以及安卓端开机APP代码
Java
6
star
20

rl3

强化学习作业,多智能体
Python
6
star
21

anime_resource_title_analyzer

分析动漫资源网站的标题信息(字幕组 + 番剧标题 + 分辨率 + 第几集)
Python
6
star
22

WeiChatJump

Java
5
star
23

FunctionWave

一个能用数学函数来作曲的小程序
Java
5
star
24

edge_charimg

把图像的边缘特征转化成字符图
Python
5
star
25

rl2

Python
3
star
26

ProgramCalculator

多功能可编程科学计算器,电子技术课程设计
Python
2
star
27

BlindWaterMarkKiller

消除知乎盲水印
Python
2
star
28

ys_solve

原神机关自动解谜
Java
2
star
29

Arduion_3Dcube

Arduion显示一个3D立方体
C++
2
star
30

BluetoothMosue

蓝牙鼠标安卓端源码
Java
2
star
31

4D-Draw

一个4D绘图引擎
Java
1
star
32

auto_helthy_report

中南大学自动每日打卡
Java
1
star
33

card_QR_door

刷卡、扫码宿舍门
C++
1
star
34

huaji_video

一个将视频滑稽化的软件
Java
1
star
35

Auto_Hand_Font

自动生成手写体文章
Java
1
star
36

my-gitpage

SCSS
1
star
37

MatrixCalculator

一个轻便的矩阵计算器,低配matlab
Java
1
star
38

arduino-badapple

用Arduino+oled屏播放badapple
C++
1
star
39

sysu_report

中山大学自动每日健康打卡
Python
1
star
40

RainbowNekoEngine

Neural network training and inference framework
Python
1
star
41

NekoFormer

All in one basic anime CV model. tagger+siglip+natural language
Python
1
star