-
-
Notifications
You must be signed in to change notification settings - Fork 881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added abilty to log prompts and info to one file instead of several #476
Conversation
This is my first pull request be gentle I made changes so instead of having several files with prompts with one for each file you can just have one file with the prompt info I also made sure the prompts would work with params in prompts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not 100% what you mean by "dynamic parameters".
What I think your goal is: writing a log file with prompts and other parameters.
If your goal is a log file you should also include timestamps.
Keep in mind that I have a pending PR #436 that lets users paste parameters, but only the yaml format is understood.
If compatibility is desired the format of the log file should be changed to YAML with the different flow style (looks like when you print a dictionary with Python).
if write_info_to_one_file: | ||
ignore_list = ["prompt", "target", "toggles", "ddim_eta", "batch_size"] | ||
rename_dict = {"ddim_steps": "steps", "n_iter": "number", "sampler_name": "sampler"} #changes the name of parameters to match with dynamic parameters | ||
sample_log_path = os.path.join(sample_path_i, "log.yaml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use the ".yaml" file ending for log files, that will confuse users trying to load settings from them using #436 .
Use a file name that ends with ".txt" or ".log" instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will change
rename_dict = {"ddim_steps": "steps", "n_iter": "number", "sampler_name": "sampler"} #changes the name of parameters to match with dynamic parameters | ||
sample_log_path = os.path.join(sample_path_i, "log.yaml") | ||
log_dump = info_dict.get("prompt") # making sure the first item that is listed in the txt is the prompt text | ||
for key, value in info_dict.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iterating over a dictionary is not guaranteed to yield items in a particular order.
With this code the order of the printed parameters can change randomly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mean for it to be in any particular order do you think that would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if that will be better.
I was merely telling you because I don't know how experienced you are.
|
||
if found_key: | ||
key = found_key | ||
log_dump += f" {key} {value}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be difficult to read.
I recommend using different separators between key and value and two pairs of key and value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the point is so you can copy them using #421 if I add separators it will break that
webui.py
Outdated
@@ -1852,6 +1884,7 @@ def run_RealESRGAN(image, model_name: str): | |||
'Save grid', | |||
'Sort samples by prompt', | |||
'Write sample info files', | |||
'Write sample info to one file', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This naming is misleading.
It will make users think that if they tick both individual sample files will not be written.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funnily I wasn't really sure what to name it do you have any suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your goal is a log file: "Write sample log files"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No wait, your files are explicitly not per sample.
"Write log files"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe
write sample info to log file?
I meant this #421 you can copy the line from the file and paste it into the prompt and it will auto add the parameters |
That's what I was assuming. |
Working for me in the video I copy and paste the parameters test.mp4sampler doesn't get applied I think that's something with dynamic |
The order of parameters in your video is the same as on my system so it's not the dictionary randomly reordering things that's causing problems. |
I made a mistake with the last commit fixing now |
This reverts commit bb10b63.
…ygil-Dev#476) * Added abilty to log prompts and info to one file instead of several This is my first pull request be gentle I made changes so instead of having several files with prompts with one for each file you can just have one file with the prompt info I also made sure the prompts would work with params in prompts * Add files via upload * Fixed Image to image not working * Add files via upload * Revert "Add files via upload" This reverts commit bb10b63. * updated log Co-authored-by: hlky <[email protected]>
This is my first pull request be gentle I made changes so instead of having a file with prompt info for each sample you can just have one file with the prompt info for all files I also made sure the prompts would work with params in prompts