()
| 6 | |
| 7 | |
| 8 | def example_1(): |
| 9 | model_manager = ModelManager(torch_dtype=torch.bfloat16, model_id_list=["FLUX.1-dev", "jasperai/Flux.1-dev-Controlnet-Upscaler"]) |
| 10 | pipe = FluxImagePipeline.from_model_manager(model_manager, controlnet_config_units=[ |
| 11 | ControlNetConfigUnit( |
| 12 | processor_id="tile", |
| 13 | model_path="models/ControlNet/jasperai/Flux.1-dev-Controlnet-Upscaler/diffusion_pytorch_model.safetensors", |
| 14 | scale=0.7 |
| 15 | ), |
| 16 | ]) |
| 17 | |
| 18 | image_1 = pipe( |
| 19 | prompt="a photo of a cat, highly detailed", |
| 20 | height=768, width=768, |
| 21 | seed=0 |
| 22 | ) |
| 23 | image_1.save("image_1.jpg") |
| 24 | |
| 25 | image_2 = pipe( |
| 26 | prompt="a photo of a cat, highly detailed", |
| 27 | controlnet_image=image_1.resize((2048, 2048)), |
| 28 | input_image=image_1.resize((2048, 2048)), denoising_strength=0.99, |
| 29 | height=2048, width=2048, tiled=True, |
| 30 | seed=1 |
| 31 | ) |
| 32 | image_2.save("image_2.jpg") |
| 33 | |
| 34 | |
| 35 |
no test coverage detected