Skip to content

Commit

Permalink
feat: Updates Facerestore node to latest version. (#284)
Browse files Browse the repository at this point in the history
* facerestore_cf commit

* Add missing nodes

* feat: ensure helper models downloaded by model manager

* fix: moved downloads to gfpgan manager

* fix: Adds clean implementation of gfpgan loading

* chore: license

* chore: only gitignore `hordelib/models/` (and not other models/ dirs)

* fix: add missing models/ files for facerestore

* tests: more stringent histogram fail for post processor image checks

* chore: clarify sourcing and licensing of facerestore_cf

* style: fix

style: fix types for pipline map

---------

Co-authored-by: tazlin <[email protected]>
  • Loading branch information
db0 and tazlin authored Jul 16, 2024
1 parent 6a238d0 commit dd829d7
Show file tree
Hide file tree
Showing 101 changed files with 14,322 additions and 4,079 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ parts/
sdist/
var/
wheels/
models/
hordelib/models/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
Expand Down
8 changes: 8 additions & 0 deletions hordelib/comfy_horde.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,14 @@ def _set_comfyui_paths(self) -> None:
_comfy_supported_pt_extensions,
)

_comfy_folder_names_and_paths["facerestore_models"] = (
[
str(UserSettings.get_model_directory() / "gfpgan"),
str(UserSettings.get_model_directory() / "codeformer"),
],
_comfy_supported_pt_extensions,
)

_comfy_folder_names_and_paths["controlnet"] = (
[
_comfy_folder_names_and_paths["controlnet"][0][0],
Expand Down
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 = { # 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
204 changes: 0 additions & 204 deletions hordelib/nodes/facerestore/__init__.py

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions hordelib/nodes/facerestore/facelib/utils/__init__.py

This file was deleted.

Loading

0 comments on commit dd829d7

Please sign in to comment.