Instructions to use georgefen/Face-Landmark-ControlNet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use georgefen/Face-Landmark-ControlNet with Diffusers:
pip install -U diffusers transformers accelerate
from diffusers import ControlNetModel, StableDiffusionControlNetPipeline controlnet = ControlNetModel.from_pretrained("georgefen/Face-Landmark-ControlNet") pipe = StableDiffusionControlNetPipeline.from_pretrained( "fill-in-base-model", controlnet=controlnet ) - Notebooks
- Google Colab
- Kaggle
Download annotator/uniformer/mmcv/utils/trace.py from georgefen/Face-Landmark-ControlNet: direct link, hf CLI and curl.
- Browser
- Download file 795 Bytes
-
https://huggingface.co/georgefen/Face-Landmark-ControlNet/resolve/main/annotator/uniformer/mmcv/utils/trace.py
- Command line
-
hf download hf://georgefen/Face-Landmark-ControlNet/annotator/uniformer/mmcv/utils/trace.py
-
curl -L -o trace.py https://huggingface.co/georgefen/Face-Landmark-ControlNet/resolve/main/annotator/uniformer/mmcv/utils/trace.py
795 Bytes
| import warnings | |
| import torch | |
| from annotator.uniformer.mmcv.utils import digit_version | |
| def is_jit_tracing() -> bool: | |
| if (torch.__version__ != 'parrots' | |
| and digit_version(torch.__version__) >= digit_version('1.6.0')): | |
| on_trace = torch.jit.is_tracing() | |
| # In PyTorch 1.6, torch.jit.is_tracing has a bug. | |
| # Refers to https://github.com/pytorch/pytorch/issues/42448 | |
| if isinstance(on_trace, bool): | |
| return on_trace | |
| else: | |
| return torch._C._is_tracing() | |
| else: | |
| warnings.warn( | |
| 'torch.jit.is_tracing is only supported after v1.6.0. ' | |
| 'Therefore is_tracing returns False automatically. Please ' | |
| 'set on_trace manually if you are using trace.', UserWarning) | |
| return False | |