Views
No views yet
| control image | weight=0.0 | weight=0.3 | weight=0.5 | weight=0.7 | weight=0.9 |
|---|---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
1import torch
2from diffusers import StableDiffusion3ControlNetPipeline
3from diffusers.models import SD3ControlNetModel, SD3MultiControlNetModel
4from diffusers.utils import load_image
5
6# load pipeline
7controlnet = SD3ControlNetModel.from_pretrained("InstantX/SD3-Controlnet-Tile")
8pipe = StableDiffusion3ControlNetPipeline.from_pretrained(
9 "stabilityai/stable-diffusion-3-medium-diffusers",
10 controlnet=controlnet
11)
12pipe.to("cuda", torch.float16)
13
14# config
15control_image = load_image("https://huggingface.co/InstantX/SD3-Controlnet-Tile/resolve/main/tile.jpg")
16prompt = 'Anime style illustration of a girl wearing a suit. A moon in sky. In the background we see a big rain approaching. text "InstantX" on image'
17n_prompt = 'NSFW, nude, naked, porn, ugly'
18image = pipe(
19 prompt,
20 negative_prompt=n_prompt,
21 control_image=control_image,
22 controlnet_conditioning_scale=0.5,
23).images[0]
24image.save('image.jpg')
25
26