From 7991f74a391ed4329066b29ddf2042e636d489fa Mon Sep 17 00:00:00 2001 From: tami-p40 Date: Sat, 18 May 2024 13:18:58 +0300 Subject: [PATCH] readme --- README.md | 16 +++++++++++----- main.py | 6 ++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 10e8e88..dcd5e8f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ # AI Powered Art in a Telegram Bot! -this is a txt2img bot to converse with SDweb bot [API](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/API) running on tami telegram channel +this is a txt2img/img2img bot to converse with SDweb bot [API](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/API) running on tami telegram channel ## How to - -supported invocation: +### txt2img `/draw ` - send prompt text to the bot and it will draw an image you can add `negative_prompt` using `ng: ` you can add `denoised intermediate steps` using `steps: ` @@ -36,11 +35,18 @@ to change the model use: - note1: Anything after ng will be considered as nergative prompt. a.k.a things you do not want to see in your diffusion! - note2: on [negative_prompt](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Negative-prompt) (aka ng): -thia is a bit of a black art. i took the recommended defaults for the `Deliberate` model from this fun [alt-model spreadsheet](https://docs.google.com/spreadsheets/d/1Q0bYKRfVOTUHQbUsIISCztpdZXzfo9kOoAy17Qhz3hI/edit#gid=797387129). -~~and you (currntly) can only ADD to it, not replace.~~ +thia is a bit of a black art. i took the recommended defaults for the `Deliberate` model from this fun [alt-model spreadsheet](https://docs.google.com/spreadsheets/d/1Q0bYKRfVOTUHQbUsIISCztpdZXzfo9kOoAy17Qhz3hI/edit#gid=797387129). - note3: on `steps` - step of 1 will generate only the first "step" of bot hallucinations. the default is 40. higher will take longer and will give "better" image. range is hardcoded 1-70. see ![video](https://user-images.githubusercontent.com/57876960/212490617-f0444799-50e5-485e-bc5d-9c24a9146d38.mp4) +### img2img +`/img ds:<0.0-1.0>` - reply to an image with a prompt text and it will draw an image + +you can add `denoising_strength` using `ds:` +Set that low (like 0.2) if you just want to slightly change things. defaults to 0.4 + +basicly anything the `/controlnet/img2img` API payload supports + ## Setup Install requirements using venv diff --git a/main.py b/main.py index 16e3460..f50cf43 100644 --- a/main.py +++ b/main.py @@ -133,8 +133,10 @@ def draw(client, message): seed_value = info.split(", Seed: ")[1].split(",")[0] caption = f"**[{message.from_user.first_name}](tg://user?id={message.from_user.id})**\n\n" - for key, value in payload.items(): - caption += f"{key.capitalize()} - **{value}**\n" + # for key, value in payload.items(): + # caption += f"{key.capitalize()} - **{value}**\n" + prompt = payload["prompt"] + caption += f"**{prompt}**\n" caption += f"Seed - **{seed_value}**\n" # Ensure caption is within the allowed length