fixed bug of neg prompt file potentially not existing
This commit is contained in:
parent
fdf98224b1
commit
de7f03bb58
1 changed files with 2 additions and 1 deletions
|
|
@ -257,11 +257,12 @@ class StableDiffusion(commands.Cog):
|
||||||
url=f"{url}/sdapi/v1/txt2img"
|
url=f"{url}/sdapi/v1/txt2img"
|
||||||
prompt = ctx.message.content.split(" ", maxsplit=1)[1]
|
prompt = ctx.message.content.split(" ", maxsplit=1)[1]
|
||||||
key_value_pairs, prompt = self.extract_key_value_pairs(prompt)
|
key_value_pairs, prompt = self.extract_key_value_pairs(prompt)
|
||||||
neg_prompt_file = f"{self.db_dir}negative_prompt.txt"
|
|
||||||
try:
|
try:
|
||||||
|
neg_prompt_file = f"{self.db_dir}negative_prompt.txt"
|
||||||
with open(neg_prompt_file, 'r') as f:
|
with open(neg_prompt_file, 'r') as f:
|
||||||
negative_prompt = f.readline()
|
negative_prompt = f.readline()
|
||||||
except:
|
except:
|
||||||
|
neg_prompt_file = f"{self.db_dir}negative_prompt.txt"
|
||||||
with open(neg_prompt_file, 'w') as f:
|
with open(neg_prompt_file, 'w') as f:
|
||||||
f.writelines("")
|
f.writelines("")
|
||||||
negative_prompt = ""
|
negative_prompt = ""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue