stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Feature Request]: Comment out certain words in prompt input box

Open Korehanandesyou opened this issue 2 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What would your feature do ?

When I write prompts, it will gets longer and become harder to read, I think it would be nice to have a way to comment out certain words like other programming languages, or if there is any other way to do this, so I could write prompts with better readability I tried use zero attention like (discribtion:0) but it seemed still have effects on final results.

Proposed workflow

  1. in prompt input box,
  2. write prompts with certain comment syntax, like //comments
  3. and webui automatically removes comments before generates images.

Additional information

No response

Korehanandesyou avatar Nov 04 '22 08:11 Korehanandesyou

I've also been wishing for this feature. It would super helpful, especially when sharing prompts. Thanks for considering.

axemaster avatar Feb 03 '23 19:02 axemaster

So I was also wishing for this, and even considering implementing it, though not too familiar with all the AI tools, and my python is somewhat rusty. But then I realized, that this feature is sorta not needed, as it can be emulated already. One can use prompt editing feature to achieve this.

say you have prompt: park night and want to comment out 'night', you can do it like this: park [night::-1] not the most elegant syntax, but works, and most likely good enough/close enough to whatever could be implemented.

morphles avatar Feb 23 '23 16:02 morphles

As a programmer, i have been wishing for this feature as well, i personally make notepad files with structures for my prompt, having comment lines that start with // or # would be very nice since it would allow me to have a prearranged structure explained in comments on multiple lines to not forget elements, I could just copy and paste them into the UI and modify them right away.

Example:

// MEDIA
{photo, 8K,

// SUBJECT
man in armor in city with gun},

// DESCRIPTOR
blue eyes, dark hair

// WEBSITE - ARTIST
artstation

// EMBEDDINGS
Style-Psycho

Alternatively since this gets sent as one string parameter this kind of syntax could also be used (C++ like)

/* EMBEDDINGS */
Style-Psycho

OR

# EMBEDDINGS #
Style-Psycho

If it were included in the picture embedded data, i think it would help people understand the structure of prompt better and promote more coherently built prompts.

Ronin825 avatar Mar 24 '23 16:03 Ronin825

try "<comment:bla bla bla>", it will call a model "comment", lol hope a better way to do comment.

NoiseDesign avatar Mar 30 '23 17:03 NoiseDesign

same trick as NoiseDesign

I am just doing this: prompt: full body middle shot, RAW photo of 25 year old male model

if I want to comment out smth: <rem:full body middle shot>, RAW photo of 25 year old male model

Not the cleanest way but it's fast and efficient!

spamnco avatar Jun 17 '23 15:06 spamnco

Closing as in the PR (https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/10486) it was determined this would not be implemented. For alternatives you could use the dynamic scripts extension or hijack the extra networks syntax, <comment:like this:0>.

catboxanon avatar Aug 12 '23 03:08 catboxanon

Some legend implemented it with a few lines of code: https://github.com/itsui/sd-webui-infolk-prompt-comment

You can even set the char to whatever you want by a simple .js edit, it's # by default.

J-PRS avatar Aug 18 '23 17:08 J-PRS