()
| 61 | |
| 62 | |
| 63 | def example_3(): |
| 64 | model_manager = ModelManager(torch_dtype=torch.bfloat16, model_id_list=["FLUX.1-dev", "InstantX/FLUX.1-dev-Controlnet-Union-alpha"]) |
| 65 | pipe = FluxImagePipeline.from_model_manager(model_manager, controlnet_config_units=[ |
| 66 | ControlNetConfigUnit( |
| 67 | processor_id="canny", |
| 68 | model_path="models/ControlNet/InstantX/FLUX.1-dev-Controlnet-Union-alpha/diffusion_pytorch_model.safetensors", |
| 69 | scale=0.3 |
| 70 | ), |
| 71 | ControlNetConfigUnit( |
| 72 | processor_id="depth", |
| 73 | model_path="models/ControlNet/InstantX/FLUX.1-dev-Controlnet-Union-alpha/diffusion_pytorch_model.safetensors", |
| 74 | scale=0.3 |
| 75 | ), |
| 76 | ]) |
| 77 | |
| 78 | image_1 = pipe( |
| 79 | prompt="a cat is running", |
| 80 | height=1024, width=1024, |
| 81 | seed=4 |
| 82 | ) |
| 83 | image_1.save("image_5.jpg") |
| 84 | |
| 85 | image_2 = pipe( |
| 86 | prompt="sunshine, a cat is running", |
| 87 | controlnet_image=image_1, |
| 88 | height=1024, width=1024, |
| 89 | seed=5 |
| 90 | ) |
| 91 | image_2.save("image_6.jpg") |
| 92 | |
| 93 | |
| 94 | def example_4(): |
no test coverage detected