Triggering txt2img generation in extension script #14612
-
I'm working on an extension that creates manages checkpoint thumbnails, and I have everything that I need for my extension sorted out to a basic level. My current issue is that I'm using the API to trigger the thumbnail generation. I would like to switch this to just trigger the generation without routing it via an API call. Most of my code is generated with ChatGPT, but I've bashed my head against it for hours now trying to switch to local generation, and I can't find the right example for me to use for local inference triggered in the script. Note that the 'set_data" and related values like "current_set_name" are unrelated to the SD code, these are to load the right values from my json-files containing the settings. Here's the code I use for generation using the API:
If someone could point me in the right direction on how to use txt2img in a similar fashion, it'd help a lot :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
A friend was able to figure it out and help me out. In case someone is trying to figure out how to generate an image with txt2img from inside Automatic1111, here's the code: `# Generate thumbnails
Again, keeping in mind that the "get_set_data" function is where I load my data from a json file. |
Beta Was this translation helpful? Give feedback.
A friend was able to figure it out and help me out. In case someone is trying to figure out how to generate an image with txt2img from inside Automatic1111, here's the code:
`# Generate thumbnails
def generate_thumbnail_for_model(model_name, suffix):
# Initialize processed to None
processed = None