Views
No views yet
| Category | Samples |
|---|---|
| long-shirt | ~383 |
| long-dress | ~413 |
| short-shirt | ~236 |
| shorts | ~74 |
| pants | ~38 |
| Total | ~1144 |
stabilityai/stable-diffusion-xl-base-1.0madebyollin/sdxl-vae-fp16-fix1import torch
2from diffusers import (
3 AutoencoderKL, ControlNetModel,
4 StableDiffusionXLControlNetPipeline, UniPCMultistepScheduler,
5)
6from PIL import Image
7
8controlnet = ControlNetModel.from_pretrained(
9 "JorgeAskur/garment-uv-controlnet-v3", torch_dtype=torch.float16
10)
11vae = AutoencoderKL.from_pretrained(
12 "madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16
13)
14pipe = StableDiffusionXLControlNetPipeline.from_pretrained(
15 "stabilityai/stable-diffusion-xl-base-1.0",
16 controlnet=controlnet, vae=vae,
17 torch_dtype=torch.float16,
18)
19pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
20pipe = pipe.to("cuda")
21
22normal_map = Image.open("normal.png").convert("RGB").resize((1024, 1024))
23atlas = pipe(
24 prompt="long-sleeved plaid shirt, cotton, red and cream checkered pattern",
25 image=normal_map,
26 num_inference_steps=40,
27 guidance_scale=7.5,
28 controlnet_conditioning_scale=1.0,
29 height=1024, width=1024,
30).images[0]
31atlas.save("atlas.png")R = (N.x * 0.5 + 0.5) * 255, same for G/B. Background should be black (0, 0, 0).