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
| # Copyright (c) OpenMMLab. All rights reserved. | |
| import torch | |
| from .hook import HOOKS, Hook | |
| class EmptyCacheHook(Hook): | |
| def __init__(self, before_epoch=False, after_epoch=True, after_iter=False): | |
| self._before_epoch = before_epoch | |
| self._after_epoch = after_epoch | |
| self._after_iter = after_iter | |
| def after_iter(self, runner): | |
| if self._after_iter: | |
| torch.cuda.empty_cache() | |
| def before_epoch(self, runner): | |
| if self._before_epoch: | |
| torch.cuda.empty_cache() | |
| def after_epoch(self, runner): | |
| if self._after_epoch: | |
| torch.cuda.empty_cache() | |