max_memory = {0:"1GB", 1:"1GB"}
pipeline = DiffusionPipeline.from_pretrained(
"stable-diffusion-v1-5/stable-diffusion-v1-5",
torch_dtype=torch.float16,
use_safetensors=True,
device_map="balanced",
+   max_memory=max_memory
)
image = pipeline("a dog").images[0]
image
```  
If a device is not present in `max_memory`, then it will be completely ignored and will not participate in the device placement.