Download src/backend/annotators/lineart_control.py from clone3/FastGUI: direct link, hf CLI and curl.
- Browser
- Download file 406 Bytes
-
https://huggingface.co/spaces/clone3/FastGUI/resolve/main/src/backend/annotators/lineart_control.py
- Command line
-
hf download hf://spaces/clone3/FastGUI/src/backend/annotators/lineart_control.py
-
curl -L -o lineart_control.py https://huggingface.co/spaces/clone3/FastGUI/resolve/main/src/backend/annotators/lineart_control.py
406 Bytes
| import numpy as np | |
| from backend.annotators.control_interface import ControlInterface | |
| from controlnet_aux import LineartDetector | |
| from PIL import Image | |
| class LineArtControl(ControlInterface): | |
| def get_control_image(self, image: Image) -> Image: | |
| processor = LineartDetector.from_pretrained("lllyasviel/Annotators") | |
| control_image = processor(image) | |
| return control_image | |