I'm working on a very simple t2i generator with simple radio button input for creating a prompt (choose an accessory).

Almost everything is working as expected, but I'm not sure if I'm doing it the best way.

I have an accessory list, and can output any of the accessories correctly... but I want NULL (wearing NO accessories) to be included if "Random" is chosen.

I'm sure there is something simple that I'm missing or maybe there's a better way to do this?

Thanks for any help!

you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 9 months ago

There are many ways, one simple is to use .replace("and wearing random", ""), so when the random is selected, "wearing random" will be replaced by an empty string "" (nothing). you put it in wAcc in the prompt, like: wAcc.replace("and wearing random", "")

  • source