Buckets:
| # OpenVINO | |
| ๐ค [Optimum](https://github.com/huggingface/optimum-intel)์ ๋ค์ํ Intel ํ๋ก์ธ์์์ ์ถ๋ก ์ ์ํํ ์ ์๋ OpenVINO์ ํธํ๋๋ Stable Diffusion ํ์ดํ๋ผ์ธ์ ์ ๊ณตํฉ๋๋ค(์ง์๋๋ ์ฅ์น์ [์ ์ฒด ๋ชฉ๋ก](https://docs.openvino.ai/latest/openvino_docs_OV_UG_supported_plugins_Supported_Devices.html)์ ์ฐธ์กฐํ์ธ์). | |
| `--upgrade-strategy eager` ์ต์ ์ ์ฌ์ฉํ์ฌ ๐ค Optimum Intel์ ์ค์นํด์ผ [`optimum-intel`](https://github.com/huggingface/optimum-intel)์ด ์ต์ ๋ฒ์ ์ ์ฌ์ฉํ๋์ง ํ์ธํ ์ ์์ต๋๋ค: | |
| ```bash | |
| pip install --upgrade-strategy eager optimum["openvino"] | |
| ``` | |
| ์ด ๊ฐ์ด๋์์๋ OpenVINO์ ํจ๊ป Stable Diffusion ๋ฐ Stable Diffusion XL (SDXL) ํ์ดํ๋ผ์ธ์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. | |
| ## Stable Diffusion | |
| ๋ก๋ ๋ฐ ์ถ๋ก ์คํ์ ์ํด `OVStableDiffusionPipeline`์ ์ฌ์ฉํฉ๋๋ค. PyTorch ๋ชจ๋ธ์ ๋ก๋ํ์ฌ OpenVINO ํ์์ผ๋ก ์ฆ์ ๋ณํํ๋ ค๋ฉด `export=True`๋ฅผ ์ค์ ํ์ธ์: | |
| ```python | |
| from optimum.intel import OVStableDiffusionPipeline | |
| model_id = "stable-diffusion-v1-5/stable-diffusion-v1-5" | |
| pipeline = OVStableDiffusionPipeline.from_pretrained(model_id, export=True) | |
| prompt = "sailing ship in storm by Rembrandt" | |
| image = pipeline(prompt).images[0] | |
| # Don't forget to save the exported model | |
| pipeline.save_pretrained("openvino-sd-v1-5") | |
| ``` | |
| ์ถ๋ก ์๋๋ฅผ ๋ ๋์ด๊ธฐ ์ํด ๋ชจ๋ธ์ ์ ์ ์ผ๋ก ๋ฆฌ์ ฐ์ดํํฉ๋๋ค. ์ถ๋ ฅ ๋์ด ๋๋ ๋๋น์ ๊ฐ์ ๋งค๊ฐ๋ณ์๋ฅผ ๋ณ๊ฒฝํ๋ฉด ๋ชจ๋ธ์ ๋ค์ ์ ์ ์ผ๋ก ๋ฆฌ์ ฐ์ดํํด์ผ ํฉ๋๋ค. | |
| ```python | |
| # Define the shapes related to the inputs and desired outputs | |
| batch_size, num_images, height, width = 1, 1, 512, 512 | |
| # Statically reshape the model | |
| pipeline.reshape(batch_size, height, width, num_images) | |
| # Compile the model before inference | |
| pipeline.compile() | |
| image = pipeline( | |
| prompt, | |
| height=height, | |
| width=width, | |
| num_images_per_prompt=num_images, | |
| ).images[0] | |
| ``` | |
| ๐ค Optimum [๋ฌธ์](https://huggingface.co/docs/optimum/intel/inference#stable-diffusion)์์ ๋ ๋ง์ ์์๋ฅผ ์ฐพ์ ์ ์์ผ๋ฉฐ, Stable Diffusion์ ํ ์คํธ-์ด๋ฏธ์ง ์์ฑ, ์ด๋ฏธ์ง-์ด๋ฏธ์ง ๋ณํ, ์ธํ์ธํ ์ ์ง์ํฉ๋๋ค. | |
| ## Stable Diffusion XL | |
| SDXL๋ก ๋ก๋ํ๊ณ ์ถ๋ก ์ ์คํํ๋ ค๋ฉด `OVStableDiffusionXLPipeline`์(๋ฅผ) ์ฌ์ฉํ์ธ์: | |
| ```python | |
| from optimum.intel import OVStableDiffusionXLPipeline | |
| model_id = "stabilityai/stable-diffusion-xl-base-1.0" | |
| pipeline = OVStableDiffusionXLPipeline.from_pretrained(model_id) | |
| prompt = "sailing ship in storm by Rembrandt" | |
| image = pipeline(prompt).images[0] | |
| ``` | |
| ์ถ๋ก ์๋๋ฅผ ๋ ๋์ด๊ธฐ ์ํด, Stable Diffusion ์น์ ์ ๋์ ์๋ฏ์ด ๋ชจ๋ธ์ [์ ์ ์ผ๋ก ๋ฆฌ์ฌ์ด์ฆ](#stable-diffusion)ํฉ๋๋ค. | |
| ๐ค Optimum [๋ฌธ์](https://huggingface.co/docs/optimum/intel/inference#stable-diffusion-xl)์์ ๋ ๋ง์ ์์๋ฅผ ํ์ธํ ์ ์์ผ๋ฉฐ, OpenVINO์์ SDXL์ ์คํํ๋ ๊ธฐ๋ฅ์ ํ ์คํธ-์ด๋ฏธ์ง ์์ฑ ๋ฐ ์ด๋ฏธ์ง-์ด๋ฏธ์ง ๋ณํ์ ์ง์ํฉ๋๋ค. | |
Xet Storage Details
- Size:
- 3.08 kB
- Xet hash:
- 375bfa95a629c2ec20bafdf593dd0bad2767329dcfeee746d2cfcd428dcc3dda
ยท
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.