mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
add negative prompt to log when clicking save #249
This commit is contained in:
parent
45e8fa0e07
commit
a655e90fbe
@ -65,6 +65,7 @@ class Processed:
|
|||||||
def __init__(self, p: StableDiffusionProcessing, images_list, seed, info):
|
def __init__(self, p: StableDiffusionProcessing, images_list, seed, info):
|
||||||
self.images = images_list
|
self.images = images_list
|
||||||
self.prompt = p.prompt
|
self.prompt = p.prompt
|
||||||
|
self.negative_prompt = p.negative_prompt
|
||||||
self.seed = seed
|
self.seed = seed
|
||||||
self.info = info
|
self.info = info
|
||||||
self.width = p.width
|
self.width = p.width
|
||||||
@ -76,6 +77,7 @@ class Processed:
|
|||||||
def js(self):
|
def js(self):
|
||||||
obj = {
|
obj = {
|
||||||
"prompt": self.prompt if type(self.prompt) != list else self.prompt[0],
|
"prompt": self.prompt if type(self.prompt) != list else self.prompt[0],
|
||||||
|
"negative_prompt": self.negative_prompt if type(self.negative_prompt) != list else self.negative_prompt[0],
|
||||||
"seed": int(self.seed if type(self.seed) != list else self.seed[0]),
|
"seed": int(self.seed if type(self.seed) != list else self.seed[0]),
|
||||||
"width": self.width,
|
"width": self.width,
|
||||||
"height": self.height,
|
"height": self.height,
|
||||||
|
@ -93,7 +93,7 @@ def save_files(js_data, images):
|
|||||||
at_start = file.tell() == 0
|
at_start = file.tell() == 0
|
||||||
writer = csv.writer(file)
|
writer = csv.writer(file)
|
||||||
if at_start:
|
if at_start:
|
||||||
writer.writerow(["prompt", "seed", "width", "height", "sampler", "cfgs", "steps", "filename"])
|
writer.writerow(["prompt", "seed", "width", "height", "sampler", "cfgs", "steps", "filename", "negative_prompt"])
|
||||||
|
|
||||||
filename_base = str(int(time.time() * 1000))
|
filename_base = str(int(time.time() * 1000))
|
||||||
for i, filedata in enumerate(images):
|
for i, filedata in enumerate(images):
|
||||||
@ -108,7 +108,7 @@ def save_files(js_data, images):
|
|||||||
|
|
||||||
filenames.append(filename)
|
filenames.append(filename)
|
||||||
|
|
||||||
writer.writerow([data["prompt"], data["seed"], data["width"], data["height"], data["sampler"], data["cfg_scale"], data["steps"], filenames[0]])
|
writer.writerow([data["prompt"], data["seed"], data["width"], data["height"], data["sampler"], data["cfg_scale"], data["steps"], filenames[0], data["negative_prompt"]])
|
||||||
|
|
||||||
return '', '', plaintext_to_html(f"Saved: {filenames[0]}")
|
return '', '', plaintext_to_html(f"Saved: {filenames[0]}")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user