Views
No views yet
promeai/FLUX.1-controlnet-lineart-promeai holds controlnet weights trained on black-forest-labs/FLUX.1-dev with lineart condition.| input-control | result image |
|---|---|
![]() | ![]() |
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 = 'promeai/FLUX.1-controlnet-lineart-promeai'
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("./images/example-control.jpg")
13prompt = "cute anime girl with massive fluffy fennec ears and a big fluffy tail blonde messy long hair blue eyes wearing a maid outfit with a long black gold leaf pattern dress and a white apron mouth open holding a fancy black forest cake with candles on top in the kitchen of an old dark Victorian mansion lit by candlelight with a bright window to the foggy forest and very expensive stuff everywhere"
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")