Video-to-Video
Diffusers
English
Chinese
video-editing
streaming
quantization
int8
text-stream-stripping
Instructions to use kylinfires/Joy-face_change_optimized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use kylinfires/Joy-face_change_optimized with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("kylinfires/Joy-face_change_optimized", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Download training/src/utils/utils.py from kylinfires/Joy-face_change_optimized: direct link, hf CLI and curl.
- Browser
- Download file 628 Bytes
-
https://huggingface.co/kylinfires/Joy-face_change_optimized/resolve/main/training/src/utils/utils.py
- Command line
-
hf download hf://kylinfires/Joy-face_change_optimized/training/src/utils/utils.py
-
curl -L -o utils.py https://huggingface.co/kylinfires/Joy-face_change_optimized/resolve/main/training/src/utils/utils.py
628 Bytes
| import importlib | |
| def get_obj_from_str(string): | |
| module, cls = string.rsplit(".", 1) | |
| return getattr(importlib.import_module(module), cls) | |
| def build_from_config(config, **kwargs): | |
| if "target" not in config: | |
| raise KeyError("Expected key `target` to instantiate.") | |
| cls = get_obj_from_str(config["target"]) | |
| params = dict(config.get("params", {})) | |
| params.update(kwargs) | |
| pretrained_path = config.get("pretrained", None) | |
| if pretrained_path is not None and hasattr(cls, "from_pretrained"): | |
| return cls.from_pretrained(pretrained_path, **params) | |
| obj = cls(**params) | |
| return obj | |