Spaces:
Runtime error
Runtime error
Download model.py from bala1802/StableDiffusionModel: direct link, hf CLI and curl.
- Browser
- Download file 698 Bytes
-
https://huggingface.co/spaces/bala1802/StableDiffusionModel/resolve/5d4e53135ab5bb8afced0fcd59c461e433123ecf/model.py
- Command line
-
hf download hf://spaces/bala1802/StableDiffusionModel@5d4e53135ab5bb8afced0fcd59c461e433123ecf/model.py
-
curl -L -o model.py https://huggingface.co/spaces/bala1802/StableDiffusionModel/resolve/5d4e53135ab5bb8afced0fcd59c461e433123ecf/model.py
698 Bytes
| import torch | |
| from diffusers import DiffusionPipeline | |
| import config | |
| def initialize_diffusion_model(): | |
| pretrained_model_name_or_path = config.STABLE_DIFFUSION_MODEL | |
| pipe = DiffusionPipeline.from_pretrained(pretrained_model_name_or_path, | |
| torch_dtype=torch.float16).to(config.DEVICE) | |
| pipe.load_textual_inversion("sd-concepts-library/dreams") | |
| pipe.load_textual_inversion("sd-concepts-library/midjourney-style") | |
| pipe.load_textual_inversion("sd-concepts-library/moebius") | |
| pipe.load_textual_inversion("sd-concepts-library/style-of-marc-allante") | |
| pipe.load_textual_inversion("sd-concepts-library/wlop-style") | |
| return pipe |