This looks really easy to build with! Here are some notes:
The function definition would look something like:
class CreateImage:
def __init__(self, app):
self.app = app
self.reg = app.ai_functions.define(self.run, 'create_image', 'Create a new image',
short_description="create images")
self.reg.add_argument('description', 'An in-depth one line description of the image to create', question="What is the description of the image?")
self.reg.add_argument('count', 'Number of sample images to create (default is 1)', question="How many images did the user request?")
self.reg.add_to('Artist')
Add a config file section for it:
[a1111]
base_url = 'http://localhost:7860/' # App will append /sdapi/v1/txt2img
Then it's just a matter of sending the description to the API, writing the images to the data/uploads/ folder, and sending the response back, like f"I created an image for you: "
AUTOMATIC1111 has an API: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/API
This looks really easy to build with! Here are some notes:
The function definition would look something like:
Add a config file section for it:
Then it's just a matter of sending the description to the API, writing the images to the data/uploads/ folder, and sending the response back, like f"I created an image for you: "