AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Image generation improvements

Open Tymec opened this issue 1 year ago • 5 comments

Background

AUTOMATIC1111/stable-diffusion-webui exposes an API for generating images using it. This feature can be useful for cutting down costs for generating images and allowing flexibility and more power for tweaking image generation. By using the API exposed by AUTOMATIC1111/stable-diffusion-webui, we can generate images more efficiently and flexibly. This feature allows us to reduce the costs of image generation and to customize the image generation parameters for different models and settings.

Changes

  • Added support for using AUTOMATIC1111/stable-diffusion-webui API as an image provider
  • Renamed "sd" image provider to "huggingface" to avoid confusion
  • Added config options to change HuggingFace text-to-image model, image size, image count and SD WebUI settings
  • Modified the generate_image function to accept arguments for prompt, negative prompt, num_images, image_size, model and extra params

Documentation

  • The code changes are documented using docstrings and comments

Test Plan

  • Created a unit test module for image generation to test each image provider

PR Quality Checklist

  • [x] My pull request is atomic and focuses on a single change.
  • [x] I have thoroughly tested my changes with multiple different prompts.
  • [x] I have considered potential risks and mitigations for my changes.
  • [x] I have documented my changes clearly and comprehensively.
  • [ ] I have not snuck in any "extra" small tweaks changes

Tymec avatar Apr 15 '23 05:04 Tymec

I'm not sure whether adding the huggingface image model option breaks the atomicity of this pull request, so if there's any issues with that, please let me know.

Tymec avatar Apr 15 '23 05:04 Tymec

@Tymec There are conflicts now

nponeccop avatar Apr 16 '23 15:04 nponeccop

@Tymec CI is red

nponeccop avatar Apr 16 '23 17:04 nponeccop

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 17 '23 17:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 17 '23 17:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 17 '23 18:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 18 '23 23:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 18 '23 23:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 18 '23 23:04 github-actions[bot]