koishijs / novelai-bot

Generate images by NovelAI | 基于 NovelAI 的画图机器人
https://bot.novelai.dev
MIT License
2.49k stars 204 forks source link

Feature: 关于重绘强度 #184

Closed ShanShuWu closed 1 year ago

ShanShuWu commented 1 year ago

Scope

Stable Diffusion WebUI (AUTOMATIC1111)

Describe the problem related to the feature request

这个功能我输入-e提示我不能用增强功能,返回为 增强功能仅适用于被生成的图片。普通的 img2img 请直接使用「约稿」而不是「增强」。我想知道这个功能的具体使用方法,以图绘图很需要这个参数来让成品和原图尽量相似

Describe the solution you'd like

重绘强度,使出图和原图提高相似度(可能已经实现,但我实在不会用)

Describe alternatives you've considered

No response

Additional context

No response

MaikoTan commented 1 year ago

这个问题不止一个,我想逐一回答。

Re: 重绘强度

关于 "重绘强度",我想你指的是初始图像和结果图像之间的差异,这在稳定扩散模型中被称为去噪强度

如果你输入help novelai,你会看到这样的输出。

novelai <prompts>
从Novel AI生成图像
别名:nai。
输入 "novelai "的英文提示或标签,例如,森林中的女孩,金发,红眼,白裙子,等等。
你也可以使用逗号分隔的标签,如Danbooru上的标签。
星星吧:https://github.com/koishijs/novelai-bot
可用的选项。
    -r, --resolution <resolution> 设置图像分辨率
    -o, --输出
    -O, --override 禁用默认提示语
    -s, --sampler <sampler> 设置采样器
    -x, --seed <seed> 设置随机种子
    -t, --steps <step> 设置迭代步数
    -c, --scale <scale> 设置CFG规模
+   -N, --strength <strength> 设置去噪强度
    -u, --undesired <undesired> 负面提示
    -i, --iterations <iterations> 设置批量计数。

所以你学会了如何控制它:只要在0~1中加入-N-strength的浮点数。

关于:增强模式

在这个错误信息上有一点过时了。增强模式只能用于生成的图像。如果你使用正常的img2img,请使用 "novelai",不要使用增强选项。 历史上我们只支持NovelAI的小说生成AI服务网站,所以这里的信息没有明确提到。事实上,只有当你使用NovelAI作为后台时,增强模式才可用。

关于:目前使用img2img的方式

这是非常简单和直接的。你向novelai <your-prompt>发送一张图片,然后你发送的图片将被用作初始图片送入稳定的扩散模型。 对于一些不支持文本-图像-混合信息的过时的聊天平台,你也可以先发送一个图像,然后用novelai命令quote(或reply)这个信息。

通过www.DeepL.com/Translator(免费版)翻译


The original text There are more than one question in this issue, I would like to reply one by one. ## Re: redraw strength As `Redraw strength`, I am assuming you're referring the differences between the initial image and the result one, which is called [`denoising strength`](https://stable-diffusion-art.com/inpainting_basics/#Denoising_strength) in Stable Diffusion models. If you type `help novelai`, you would see the output like this: ```diff novelai Generate Images from Novel AI Aliases: nai. Enter "novelai" with English prompt or tags, e.g. a girl in the forest, blonde hair, red eyes, white dress, etc. You can also use comma separated tags like those on Danbooru. Star it: https://github.com/koishijs/novelai-bot Available options: -r, --resolution Set Image Resolution -o, --output -O, --override Disable Default Prompts -s, --sampler Set Sampler -x, --seed Set Random Seed -t, --steps Set Iteration Steps -c, --scale Set CFG Scale + -N, --strength Set Denoising Strength -u, --undesired Negative Prompt -i, --iterations Set Batch Count. ``` So you learnt how to controler it: just add `-N` or `--strength` with a float number in 0~1. ## Re: enhance mode There is a bit obsolete on this error message: `The Enhance mode can only be used for images generated. Use "novelai" without enhance option if you are using normal img2img.` Historically we only support [NovelAI](https://novelai.net/) the novel generation AI service website, so the message here didn't explicitly mention. In fact, the enhance mode is only available if you are using `NovelAI` as the backend. ## Re: the current way to use img2img It is very simple and straightforward. You send `novelai ` with an image, then the image you sent would be used as the initial image fed to stable diffusion model. For some obsolete chat platform that don't support text-image-mixin messages, you could also send an image first, and then `quote` (or `reply`) the message with `novelai` command.