Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
eagarvey-amd committed May 31, 2024
1 parent 5941c8f commit e41cf1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions apps/shark_studio/api/sd.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def shark_sd_fn_dict_input(
if key == "seed":
sd_kwargs[key] = int(sd_kwargs[key])

#TODO: move these checks into the UI code so we don't have gradio warnings in a generalized dict input function.
# TODO: move these checks into the UI code so we don't have gradio warnings in a generalized dict input function.
if sd_kwargs["device"] == "":
gr.Warning("No device specified. Please specify a device.")
return None, ""
Expand All @@ -301,11 +301,15 @@ def shark_sd_fn_dict_input(
gr.Warning("Max steps for sdxl-turbo is 10. 1 to 4 steps are recommended.")
return None, ""
if sd_kwargs["guidance_scale"] > 3:
gr.Warning("sdxl-turbo CFG scale should be less than 2.0 if using negative prompt, 0 otherwise.")
gr.Warning(
"sdxl-turbo CFG scale should be less than 2.0 if using negative prompt, 0 otherwise."
)
return None, ""
if sd_kwargs["target_triple"] == "":
if parse_device(sd_kwargs["device"], sd_kwargs["target_triple"])[2] == "":
gr.Warning("Target device architecture could not be inferred. Please specify a target triple, e.g. 'gfx1100' for a Radeon 7900xtx.")
gr.Warning(
"Target device architecture could not be inferred. Please specify a target triple, e.g. 'gfx1100' for a Radeon 7900xtx."
)
return None, ""

generated_imgs = yield from shark_sd_fn(**sd_kwargs)
Expand Down
2 changes: 1 addition & 1 deletion apps/shark_studio/web/utils/default_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@
"default_sd_config.json": default_sd_config,
"sdxl-30steps.json": sdxl_30steps,
"sdxl-turbo.json": sdxl_turbo,
}
}

0 comments on commit e41cf1a

Please sign in to comment.