stable-diffusion-discord-bot
stable-diffusion-discord-bot copied to clipboard
negative prompt
is there a way to add negative prompt
Not currently it seems. would love to see this added!
I would love the negative prompt too. Something like: --np {prompt}
You can change the negative prompt in the source imagine_queue/queue.go at line 348 and recompile the binary with your new negative defaults. This is what it is now:
NegativePrompt: "ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, " + "mutation, mutated, extra limbs, extra legs, extra arms, disfigured, deformed, cross-eye, " + "body out of frame, blurry, bad art, bad anatomy, blurred, text, watermark, grainy",
It's not ideal but at least for now you can add or change the "defaults". Be aware this will alter any past upscale in the database from the point you alter the negatives as I don't think they are stored in the database (I could be wrong on that). But just a heads up.
I found that part, but I am thinking about reprogramming it, but that would mean learning another coding language for me. :D I wonder if @AmajesticBob plans any updates of this amazing peace of work!!! ? <3
Bump on this request! Would be cool to put negative prompts in [square brackets] or something @AndBobsYourUncle
Here's a function to put in queue.go that can separate content in the outer [square brackets] as the negative prompt:
import (
"fmt"
"regexp"
)
func parsePrompts(input string) (string, string) {
re := regexp.MustCompile(`\[(.*?)\]`)
matches := re.FindAllStringSubmatch(input, -1)
positivePrompt := input
negativePrompt := ""
if len(matches) > 0 {
negativePrompt = matches[0][1]
positivePrompt = re.ReplaceAllString(input, "")
}
return positivePrompt, negativePrompt
}