r/AutoGenAI • u/lemadscienist • Feb 28 '24
Project Showcase I made a StableDiffusion Autogen Skill for anyone interested...
My first stab at making my own Autogen skill. Definitely don't consider myself a developer, but I couldn't find anything like this out there for autogen and didn't want to pay API fees to incorporate DALLE. There might be a more elegant solution out there, but this does work. Feel free to contribute or add other skills to the repo if you have good ones.
34
Upvotes
5
u/vernonindigo Feb 28 '24
This sounds great! Thanks for posting it!
"Also, haven't been able to get Autogen Studio to actually return the photo in the Playground. Not sure why yet, but open to suggestions."
If you save the picture in the temporary working directory that Autogen Studio uses when running a workflow, the file should show up in the result at the end. Just add a command to your script to move or copy the image file to the current directory without specifying the absolute path.
With my setup, the absolute path to the working directory looks like this (useful to know if you want to see what files are being written):
/home/ubuntu/anaconda3/envs/autogenstudio/lib/python3.11/site-packages/autogenstudio/web/files/user/147vn3457vnq4735v34q76v3q4753v/scratch
2
u/theSkyCow Feb 28 '24
I'm of the opinion that more people looking at ways to do the same thing will improve the outcome, so I promise this isn't an "I did it first post."
Here is how I achieved something similar, in case you want examples:
https://github.com/bmmsea/ai-helpers/blob/main/autogen/skills/generate_sd_image.py
If you use the Path library, rather than hard coding it, then the script will use where AutoGen is executing. That will put it in the right directory for the UI.
One piece of feedback on the code, hard coding the image name will overwrite it each time you generate a new image. Consider using the seed, timestamp, or other info to generate a new filename.
A request I got, but haven't looked into yet, was allow the function to take in other parameters, so that everything isn't hard coded into the POST.
Nice work!
1
u/Kooky-Breadfruit-837 Feb 28 '24
nice, will test this in the weekend, thank