Stable Diffusion XL (SDXL)μ Docker νκ²½μμ μ€ννκΈ° μν νλ‘μ νΈμ λλ€. SDXLμ ν μ€νΈ ν둬ννΈλ₯Ό μ λ ₯λ°μ κ³ νμ§μ μ΄λ―Έμ§λ₯Ό μμ±νλ μ΅μ AI λͺ¨λΈλ‘, 1024x1024 ν΄μλμ μ΄λ―Έμ§λ₯Ό μμ±ν μ μμ΅λλ€.
Dockerfile: NVIDIA PyTorch 곡μ μ΄λ―Έμ§ κΈ°λ° Docker νμΌDockerfile.ubuntu: Ubuntu 22.04 κΈ°λ° Docker νμΌexample.py: SDXL text-to-image μμ± μμ _README.md: μλ³Έ Diffusers README νμΌ
docker build -t diffusers-sdxl:pytorch -f Dockerfile .docker build -t diffusers-sdxl:ubuntu -f Dockerfile.ubuntu .νλ‘μ νΈ λ£¨νΈμ captions.txt νμΌμ΄ ν¬ν¨λμ΄ μμ΅λλ€. μ΄ νμΌμλ 5κ°μ μμ μΊ‘μ
μ΄ λ€μ΄μμ΅λλ€:
- Astronaut in a jungle, cold color palette, muted colors, detailed
- A majestic lion jumping from a big stone at night
- Van Gogh painting of a starry night over mountains
- A futuristic city with flying cars at sunset
- A serene Japanese garden with cherry blossoms
μνλ κ²½μ° μ΄ νμΌμ μμ νκ±°λ μλ‘μ΄ μΊ‘μ νμΌμ μμ±νμ¬ μ¬μ©ν μ μμ΅λλ€.
docker run --gpus all -v $(pwd)/output:/output diffusers-sdxl:pytorch \
python3 example.py --output /outputdocker run --gpus all -v $(pwd)/output:/output diffusers-sdxl:ubuntu \
python3 example.py --output /outputexample.pyλ λ€μ μμ
μ μνν©λλ€:
- SDXL λͺ¨λΈ λ‘λ (λΉλ μ λ€μ΄λ‘λλ μΊμ μ¬μ©)
- captions.txt νμΌμμ ν μ€νΈ ν둬ννΈ μ½κΈ°
- κ° ν둬ννΈμ λν΄ 1024x1024 μ΄λ―Έμ§ μμ±
- μμ±λ μ΄λ―Έμ§λ₯Ό output λλ ν 리μ μ μ₯
Loading SDXL model...
Loading pipeline components...: 100%|ββββββββββ| 7/7 [00:00<00:00, 7.22it/s]
Generating image 1/5: Astronaut in a jungle, cold color palette, muted colors, detailed
100%|ββββββββββ| 50/50 [00:12<00:00, 3.97it/s]
Saved: /output/Astronaut_in_a_jungle,_cold_color_palette,_muted_colors,_detailed.png
Generating image 2/5: A majestic lion jumping from a big stone at night
100%|ββββββββββ| 50/50 [00:12<00:00, 4.08it/s]
Saved: /output/A_majestic_lion_jumping_from_a_big_stone_at_night.png
Generating image 3/5: Van Gogh painting of a starry night over mountains
100%|ββββββββββ| 50/50 [00:12<00:00, 4.05it/s]
Saved: /output/Van_Gogh_painting_of_a_starry_night_over_mountains.png
Generating image 4/5: A futuristic city with flying cars at sunset
100%|ββββββββββ| 50/50 [00:12<00:00, 3.97it/s]
Saved: /output/A_futuristic_city_with_flying_cars_at_sunset.png
Generating image 5/5: A serene Japanese garden with cherry blossoms
100%|ββββββββββ| 50/50 [00:13<00:00, 3.80it/s]
Saved: /output/A_serene_Japanese_garden_with_cherry_blossoms.png
All 5 images generated successfully!
μμ±λ μ΄λ―Έμ§λ output λλ ν 리μ μ μ₯λ©λλ€. νμΌλͺ
μ μΊ‘μ
μ 곡백μ μΈλμ€μ½μ΄(_)λ‘ μΉνν ννλ‘ μ μ₯λ©λλ€.
μμ:
Astronaut in a jungleβAstronaut_in_a_jungle.pngA majestic lion jumpingβA_majestic_lion_jumping.png