Spaces:
Runtime error
Runtime error
Download image.py from LLKIM/project: direct link, hf CLI and curl.
- Browser
- Download file 528 Bytes
-
https://huggingface.co/spaces/LLKIM/project/resolve/main/image.py
- Command line
-
hf download hf://spaces/LLKIM/project/image.py
-
curl -L -o image.py https://huggingface.co/spaces/LLKIM/project/resolve/main/image.py
528 Bytes
| from diffusers import StableDiffusionXLPipeline | |
| import torch | |
| # ๋ชจ๋ธ ๋ก๋ (SDXL Base 1.0) | |
| pipe = StableDiffusionXLPipeline.from_pretrained( | |
| "stabilityai/stable-diffusion-xl-base-1.0", | |
| torch_dtype=torch.float16, | |
| variant="fp16", | |
| use_safetensors=True | |
| ).to("cuda") | |
| # ํ ์คํธ ํ๋กฌํํธ | |
| prompt = '๊ทธ๋ ๋ฅผ ๋ฐ๋ผ๋ณด๋ ํ ๋จ์์ ์ผ๋ง' | |
| # ์ด๋ฏธ์ง ์์ฑ | |
| image = pipe(prompt=prompt).images[0] | |
| image.save("output_scene2.png") | |
| print("โ ์ด๋ฏธ์ง ์ ์ฅ ์๋ฃ: output_scene2.png") | |
| print("ํ์ธ์ฉ") |