Instructions to use arlaz/modular-flux2-multidiffusion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use arlaz/modular-flux2-multidiffusion with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("arlaz/modular-flux2-multidiffusion", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
| from pathlib import Path | |
| from PIL import Image | |
| from cli import ( | |
| _default_panorama_inspection_output_path, | |
| main, | |
| make_panorama_inspection_image, | |
| ) | |
| def _solid(color): | |
| return Image.new("RGB", (2, 2), color) | |
| def test_panorama_inspection_moves_corners_to_center_quadrants(): | |
| image = Image.new("RGB", (4, 4)) | |
| image.paste(_solid((255, 0, 0)), (0, 0)) | |
| image.paste(_solid((0, 255, 0)), (2, 0)) | |
| image.paste(_solid((0, 0, 255)), (0, 2)) | |
| image.paste(_solid((255, 255, 0)), (2, 2)) | |
| inspected = make_panorama_inspection_image(image) | |
| assert inspected.getpixel((0, 0)) == (255, 255, 0) | |
| assert inspected.getpixel((3, 0)) == (0, 0, 255) | |
| assert inspected.getpixel((0, 3)) == (0, 255, 0) | |
| assert inspected.getpixel((3, 3)) == (255, 0, 0) | |
| def test_inspect_panorama_command_writes_default_output(tmp_path): | |
| input_path = tmp_path / "output.png" | |
| Image.new("RGB", (4, 4), (255, 0, 0)).save(input_path) | |
| main(["inspect-panorama", str(input_path)]) | |
| assert _default_panorama_inspection_output_path(input_path).exists() | |
| def test_default_panorama_inspection_output_path(): | |
| assert _default_panorama_inspection_output_path(Path("output.png")) == Path("output_panorama_seams.png") | |