grid = make_image_grid(all_images, num_rows, num_samples_per_row)
grid
```  
<div class="flex justify-center">
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/textual_inversion_inference.png">
</div>