# Diffuser API Inference Community Limited to 1 Image Return

**URL:** <https://discuss.huggingface.co/t/diffuser-api-inference-community-limited-to-1-image-return/35998>\
**Category:** Inference Endpoints on the Hub\
**Created:** [April 8, 2023, 11:57pm UTC](https://discuss.huggingface.co/t/diffuser-api-inference-community-limited-to-1-image-return/35998 "2023-04-08T23:57:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![teamtalawa](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@teamtalawa](https://discuss.huggingface.co/u/teamtalawa)\
**Post date:** [April 8, 2023, 11:57pm UTC](https://discuss.huggingface.co/t/diffuser-api-inference-community-limited-to-1-image-return/35998/1 "2023-04-08T23:57:10Z")

</div>

I am trying to return multiple generated images with one prompt by using `num_images_per_prompt` when calling a custom model through `StableDiffusionPipeline`.

However, the API Response always returns only 1 image, independently of the amount in `num_images_per_prompt`.  
This is due to line `return images[0]` in [api-inference-community/text\_to\_image.py](https://github.com/huggingface/api-inference-community/blob/main/docker_images/diffusers/app/pipelines/text_to_image.py#L73).

I am wondering if there is any reason to limit the returned amount to only 1 image.  
Could this be increased? If not, calling the API multiple times is the best option to get multiple images?

Thank you.
