p1atdev / LECO

Low-rank adaptation for Erasing COncepts from diffusion models.
https://arxiv.org/abs/2303.07345
Apache License 2.0
307 stars 23 forks source link

Add negative prompts will degrade the sdxl lora effect #27

Open whmc76 opened 1 year ago

whmc76 commented 1 year ago

我想使用训练出的lora模型提升画面质量并且改变图像风格,但是我发现如果在negative prompt里面写上一些内容(比如 nsfw,dog),画面会变得非常糟糕,除非我堆砌非常多的低质词,但这样就让我的lora变得没有意义了。下面是我训练的脚本和结果。

这个问题在我测试质量词和画风词的时候都可以明显地观察到,如果只写正面提示词,使负面提示词保持空白,那么画面是非常好的。 但是如果只写一些简单的负面提示词,看起来原本发生作用的正面提示效果也被减去了。

并且使用webui和comfyui所表现的结果也有很大区别,这可能和他们不同的prompt处理方式有关,comfyui即使使用空白的负面提示词也不能很好的输出画面,

I want to use the trained lora model to improve the picture quality and change the image style, but I found that if I write something in the negative prompt (such as nsfw, dog), the picture will become very bad unless I pile up a lot of low-quality words, but this makes my lora meaningless. Below is the script and results of my training.

This problem can be clearly observed when I test both quality words and style words. If only positive prompt words are written and negative prompt words are kept blank, then the picture is very good. But if you just write some simple negative cues, the positive cues that seem to be working are also subtracted.

config file: pretrained_model: name_or_path: "E:\sd-webui-aki-v4.2\models\Stable-diffusion\DBtrain\AnimeXL_v01OG.safetensors"

you can also use .ckpt or .safetensors models

v2: false # true if model is v2.x v_pred: false # true if model uses v-prediction

network: type: "c3lier" # or "c3lier" rank: 128 alpha: 16.0 training_method: "full" # selfattn, xattn, noxattn, or innoxattn

train: precision: "bfloat16" noise_scheduler: "euler_a" # or "ddpm", "lms", "euler_a" iterations: 1000 lr: 1e-4 optimizer: "adam8bit" lr_scheduler: "cosine_with_restarts" max_denoising_steps: 50

save: name: "darkPizzaXL_v3" path: "./output" per_steps: 250 precision: "bfloat16"

logging: use_wandb: false verbose: true

other: use_xformers: true

webui result with negative prompt: nsfw/low quality/NONE xyz_grid-0018-4066972804-best quality, masterpiece, 4k, highres,intricate detailed, hdr, 1girl,dolman,frozen lakeside,bust shot,

comfyui result with nsfw/low quality/ /many low quality words ComfyUI_00004_

image meta data image image

FrostyForest commented 1 year ago

为什么有3个promtfile,你上面这些图用的lora是哪个promptfile训练的

whmc76 commented 1 year ago

为什么有3个promtfile,你上面这些图用的lora是哪个promptfile训练的

这是一个文件,写了三段