()
| 34 | |
| 35 | |
| 36 | def example_2(): |
| 37 | model_manager = ModelManager(torch_dtype=torch.bfloat16, model_id_list=["FLUX.1-dev", "jasperai/Flux.1-dev-Controlnet-Upscaler"]) |
| 38 | pipe = FluxImagePipeline.from_model_manager(model_manager, controlnet_config_units=[ |
| 39 | ControlNetConfigUnit( |
| 40 | processor_id="tile", |
| 41 | model_path="models/ControlNet/jasperai/Flux.1-dev-Controlnet-Upscaler/diffusion_pytorch_model.safetensors", |
| 42 | scale=0.7 |
| 43 | ), |
| 44 | ]) |
| 45 | |
| 46 | image_1 = pipe( |
| 47 | prompt="a beautiful Chinese girl, delicate skin texture", |
| 48 | height=768, width=768, |
| 49 | seed=2 |
| 50 | ) |
| 51 | image_1.save("image_3.jpg") |
| 52 | |
| 53 | image_2 = pipe( |
| 54 | prompt="a beautiful Chinese girl, delicate skin texture", |
| 55 | controlnet_image=image_1.resize((2048, 2048)), |
| 56 | input_image=image_1.resize((2048, 2048)), denoising_strength=0.99, |
| 57 | height=2048, width=2048, tiled=True, |
| 58 | seed=3 |
| 59 | ) |
| 60 | image_2.save("image_4.jpg") |
| 61 | |
| 62 | |
| 63 | def example_3(): |
no test coverage detected