feat: add configurable parameters for Stable Diffusion Structured tool #4558
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
cfg_scale
,steps
,width
, andheight
allows for fine-tuning of the image generation process to suit specific needs..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
fileUpdated the
StableDiffusionAPI
class to use these configurable parametersImplemented 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.