()
| 92 | |
| 93 | |
| 94 | def example_4(): |
| 95 | model_manager = ModelManager(torch_dtype=torch.bfloat16, model_id_list=["FLUX.1-dev", "InstantX/FLUX.1-dev-Controlnet-Union-alpha"]) |
| 96 | pipe = FluxImagePipeline.from_model_manager(model_manager, controlnet_config_units=[ |
| 97 | ControlNetConfigUnit( |
| 98 | processor_id="canny", |
| 99 | model_path="models/ControlNet/InstantX/FLUX.1-dev-Controlnet-Union-alpha/diffusion_pytorch_model.safetensors", |
| 100 | scale=0.3 |
| 101 | ), |
| 102 | ControlNetConfigUnit( |
| 103 | processor_id="depth", |
| 104 | model_path="models/ControlNet/InstantX/FLUX.1-dev-Controlnet-Union-alpha/diffusion_pytorch_model.safetensors", |
| 105 | scale=0.3 |
| 106 | ), |
| 107 | ]) |
| 108 | |
| 109 | image_1 = pipe( |
| 110 | prompt="a beautiful Asian girl, full body, red dress, summer", |
| 111 | height=1024, width=1024, |
| 112 | seed=6 |
| 113 | ) |
| 114 | image_1.save("image_7.jpg") |
| 115 | |
| 116 | image_2 = pipe( |
| 117 | prompt="a beautiful Asian girl, full body, red dress, winter", |
| 118 | controlnet_image=image_1, |
| 119 | height=1024, width=1024, |
| 120 | seed=7 |
| 121 | ) |
| 122 | image_2.save("image_8.jpg") |
| 123 | |
| 124 | |
| 125 |
no test coverage detected