Skip to content

Commit

Permalink
Update docker_images/diffusers/app/pipelines/text_to_image.py
Browse files Browse the repository at this point in the history
Co-authored-by: apolinário <[email protected]>
  • Loading branch information
oOraph and apolinario authored Oct 25, 2024
1 parent 8410cc9 commit 6c3f28f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docker_images/diffusers/app/pipelines/text_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,11 @@ def _process_req(self, inputs, **kwargs):
kwargs["num_inference_steps"] = 20
# Else, don't specify anything, leave the default behaviour

if int(kwargs.get("num_inference_steps", 20)) <= 4 and 'guidance_scale' not in kwargs.keys():
kwargs["guidance_scale"] = 0

if "guidance_scale" not in kwargs:
default_guidance_scale = os.getenv("DEFAULT_GUIDANCE_SCALE")
if default_num_steps:
kwargs["guidance_scale"] = int(default_guidance_scale)
# Else, don't specify anything, leave the default behaviour
if "seed" in kwargs:
seed = int(kwargs["seed"])
generator = torch.Generator().manual_seed(seed)
Expand Down

0 comments on commit 6c3f28f

Please sign in to comment.