Skip to content

Commit

Permalink
style: fix types for pipline map
Browse files Browse the repository at this point in the history
  • Loading branch information
tazlin committed Jul 16, 2024
1 parent 596c783 commit 5758d3d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hordelib/horde.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class HordeLib:
}

# pipeline parameter <- hordelib payload parameter mapping
PAYLOAD_TO_PIPELINE_PARAMETER_MAPPING: dict[str, str | FunctionType] = { # FIXME
PAYLOAD_TO_PIPELINE_PARAMETER_MAPPING: dict[str, str | Callable] = { # FIXME
"sampler.sampler_name": "sampler_name",
"sampler.cfg": "cfg_scale",
"sampler.denoise": "denoising_strength",
Expand Down Expand Up @@ -820,6 +820,9 @@ def _final_pipeline_adjustments(self, payload, pipeline_data) -> tuple[dict, lis
# values for steps on things like stable cascade
if isinstance(key, FunctionType):
pipeline_params[newkey] = key(payload)
elif not isinstance(key, str):
logger.error(f"Invalid key {key}")
raise RuntimeError(f"Invalid key {key}")
elif "*" in key:
key, multiplier = key.split("*", 1)
elif key in payload:
Expand Down

0 comments on commit 5758d3d

Please sign in to comment.