Commit Graph

20 Commits

Author SHA1 Message Date
Bryce Drennan
601a112dc3
refactor: move download related functions to separate module (#453)
+ renames and typehints
2024-01-14 16:50:17 -08:00
Bryce
5bbb09f69e build: vendorize facexlib
had too many unused sub-dependencies

also monkeypatch the download mechanism to use our standard download function
2024-01-06 17:23:27 -08:00
Bryce
9e3403df89 feature: clean up terminal output
- recording timing and memory usage of various steps
- re-use logging context for composition images
- load sdxl weights in a more VRAM efficient way
- switch to diffusers weights for default weights for sd15
2024-01-01 15:15:31 -08:00
Bryce
32b5175e0e feature: better upscaling
- use face enhancement in a smarter way that doesn't blur high-res images
- use a different upscale model for composition images

**Upscaling**
RealESRGAN is great but it blurs parts of images it doesn't understand

4xUltrasharp is a finetune of RealESRGan that isn't as good but doesn't have this blurry patch problem.  This makes it more suitable to use as part of the composition/upscale process.  We still use realesrgan for any last-step upscales since it does look better.

had to write a state dict translator to use the ultrasharp model

**Face Enhancement**

We no longer enhance faces that are larger than 512 pixels. They should already have enough details and the face enhancer doesn't produce faces at high enough resolution to look good at that size.
2023-12-21 05:48:02 -08:00
Bryce
ad561e8833 refactor: move model_manager to utils 2023-12-15 14:32:01 -08:00
Bryce
316114e660 docs: add docstrings
Wrote an openai script and custom prompt to generate them.
2023-12-15 14:32:01 -08:00
Bryce
558d3388e5 style: speed up linting and autoformatting. fix lints 2023-09-29 23:01:50 -07:00
Bryce
37d6642c83 fix: fix model downloads that were broken
by [library change in transformers 4.27.0](8f3b4a1d5b)
2023-03-18 13:49:11 -07:00
Bryce
1c986d8644 fix: use py3.7 compat lru_cache
- disable lint fixer that updates to newer syntax
2023-01-22 18:24:57 -08:00
Bryce
fad7f17790 feature: run face enhancement on the GPU
Should run 10x faster
2023-01-16 12:49:14 -08:00
Bryce
5cc73f6087 feature: finetuning
- feature: finetuning your own image models
- feature: image prep command. crops to face or other interesting parts of photo
- fix: back-compat for hf_hub_download
- feature: add prune-ckpt command
- feature: allow specification of model config file
2023-01-16 01:35:59 -08:00
Bryce
35ac8d64d7 build: vendorize parts of basicsr
Trying to get rid of tb-nightly dependency and any other unnecessary dependencies.
2023-01-08 22:20:22 -08:00
Bryce
1381c7fed4 lint: new ruff linter 2023-01-02 14:11:36 -08:00
Bryce
021a0c540d feature: inpainting model support; improved model manager 2022-10-25 20:07:35 -07:00
Bryce
7ae77faf07 refactor: log indentation via formatter
Replace manual indentation with a context-aware logging formatter.
2022-10-10 22:32:39 -05:00
Bryce
bc135724a3 fix: fix memory leak in face enhancer
thanks to @h4rk8s for discovering and finding a remedy

root cause was a model being instantiated inside
FaceRestoreHelper
2022-09-27 21:45:32 -07:00
Bryce
69af07ab67 style: fix lint issues 2022-09-24 00:31:08 -07:00
Bryce
d7cbf6e416 refactor: cleanup ddim
- delete more unused code
- fix some lints
2022-09-17 14:02:27 -07:00
Bryce
19d0b563ac style: lint fixes. remove unused code 2022-09-16 09:24:24 -07:00
Bryce
541ecb9701 feature: face enhancement and upscaling!! 2022-09-13 00:27:53 -07:00