Views
No views yet
1024*1024 at multi-scale.
We trained for 30k steps using a batch size of 8*8.

1import torch
2from diffusers.utils import load_image
3from diffusers.pipelines.flux.pipeline_flux_controlnet import FluxControlNetPipeline
4from diffusers.models.controlnet_flux import FluxControlNetModel
5
6base_model = 'black-forest-labs/FLUX.1-dev'
7controlnet_model = 'InstantX/FLUX.1-dev-Controlnet-Canny'
8controlnet = FluxControlNetModel.from_pretrained(controlnet_model, torch_dtype=torch.bfloat16)
9pipe = FluxControlNetPipeline.from_pretrained(base_model, controlnet=controlnet, torch_dtype=torch.bfloat16)
10pipe.to("cuda")
11
12control_image = load_image("https://huggingface.co/InstantX/FLUX.1-dev-Controlnet-Canny/resolve/main/canny.jpg")
13prompt = "A girl in city, 25 years old, cool, futuristic"
14image = pipe(
15 prompt,
16 control_image=control_image,
17 controlnet_conditioning_scale=0.6,
18 num_inference_steps=28,
19 guidance_scale=3.5,
20).images[0]
21image.save("image.jpg")