How to batch sending PNG Info to txt2img #7852
-
What I'm trying to do: I have a series of images that I generated (let's call those source images). When I download a new model, I want to generate new images with same parameters as those source images. So what I do is I put the "source" image in the PNG Info tab, and then use Send to txt2img, then I click generate. Since I have many images this is taking too long to do manually. I've tried a few things to automate:
So at that point, I thought that the best way would be to create a txt2img script that uses a file (or textbox) with the list of the source images' path. And then for each file get the info, and generate the image. So I started a script for txt2img, using prompts_from_file.py as a starting point, I'm able to setup the UI properly, I'm able to get the textinfo with |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I made some progress, I think I'm almost there. I just need to map parameters properly. I get the source image parameters using
and I suspect I need to send
I can easily write the code to do that, but I'm wondering if there's already the function to do that, or the mapping. I've only found partial mapping info. |
Beta Was this translation helpful? Give feedback.
-
Ok, it was actually faster to write my own mapping conversion than looking up if one exists. So I was able to create a custom script that:
I've also added a checkbox to reuse same model as well, but I need to test if that actually works. I didn't implement face restoration as it seems stable-diffusion_webui doesn't store that information in the image. Maybe I'll share my script after testing the checkbox feature if some are interested. |
Beta Was this translation helpful? Give feedback.
Ok, it was actually faster to write my own mapping conversion than looking up if one exists.
So I was able to create a custom script that:
I've also added a checkbox to reuse same model as well, but I need to test if that actually works.
I didn't implement face restoration as it seems stable-diffusion_webui doesn't store that information in the image.
Maybe I'll share my script after testing the checkbox feature if some are interested.