diff --git a/backend/python/diffusers/backend.py b/backend/python/diffusers/backend.py index 00b292292949..1b68372d8215 100755 --- a/backend/python/diffusers/backend.py +++ b/backend/python/diffusers/backend.py @@ -865,7 +865,12 @@ def GenerateImage(self, request, context): ).images[0] # save the result - image.save(request.dst) + temp_format = kwargs.get('tmp_file_format') + if request.dst.endswith('.tmp') and temp_format: + # Enforce uppercase string format (e.g., 'png' -> 'PNG') + image.save(request.dst, format=str(temp_format).upper()) + else: + image.save(request.dst) return backend_pb2.Result(message="Media generated", success=True) diff --git a/docs/content/features/image-generation.md b/docs/content/features/image-generation.md index fa2a1eb91164..b07eddb214bd 100644 --- a/docs/content/features/image-generation.md +++ b/docs/content/features/image-generation.md @@ -212,6 +212,7 @@ The following parameters are available in the configuration file: | `pipeline_type` | Pipeline type | `AutoPipelineForText2Image` | | `lora_adapters` | A list of lora adapters (file names relative to model directory) to apply | None | | `lora_scales` | A list of lora scales (floats) to apply | None | +| `tmp_file_format` | Specifies the file format used to save temporary output images | None | There are available several types of schedulers: