Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add configurable parameters for Stable Diffusion Structured tool #4558

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

aleibovici
Copy link

@aleibovici aleibovici commented Oct 27, 2024

Pull Request Template

Summary

This commit message reflects the changes made to the StableDiffusionAPI class, where new configurable parameters (cfg_scale, steps, width, and height) have been added and are now being used in the image generation payload. These parameters can be set through environment variables, providing more flexibility in configuring the Stable Diffusion image generation process.

Benefits

  1. Increased Flexibility: Users can now easily adjust key parameters of the Stable Diffusion model without modifying the code.
  2. Improved Customization: The ability to set cfg_scale, steps, width, and height allows for fine-tuning of the image generation process to suit specific needs.
  3. Better Development and Testing: Developers can quickly experiment with different parameter values by changing the .env file.

Change Type

  • New feature (non-breaking change which adds functionality)

  • This change requires a documentation update

  • Added new environment variables for Stable Diffusion parameters in the .env file

  • Updated the StableDiffusionAPI class to use these configurable parameters

  • Implemented fallback values for each parameter if not set in the environment

Usage

To use the new configurable parameters, add the following lines to your .env file and adjust the values as needed:

Testing

SD_CFG_SCALE=7.5
SD_STEPS=50
SD_WIDTH=512
SD_HEIGHT=512

If any of these variables are not set, the system will use default values as defined in the StableDiffusionAPI class.

Testing

Please test the image generation process with various parameter combinations to ensure the changes work as expected across different scenarios.

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

@aleibovici
Copy link
Author

aleibovici commented Nov 4, 2024

Hi there, is there any way we can merge this into the dev branch? It’s a small non-breaking change that will make it easier for us to set stable diffusion parameters using a config file. Right now it's all hardcoded. -Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant