dimitribarbot / sd-webui-birefnet

BiRefNet for AUTOMATIC1111 Stable Diffusion WebUI
Other
23 stars 0 forks source link

How to save as .jpg #4

Open GenJiGu opened 1 month ago

GenJiGu commented 1 month ago

I think it would be a good idea to add a setting that allows users to choose to save as either PNG or JPG.

dimitribarbot commented 1 month ago

Hi,

Are you talking about Automatic1111's SD WebUI or using the API (or both)?

In the UI, you can define the output extension format in your "Settings" tab, under the "Saving images/grids" menu: image

You can set the extension (without the leading dot) in the "File format for images" section and then click on the "Apply settings" button. Note that it will impact all output images of the application though.

When using the API, if you update your extension to the latest version (in UI, by going to your "Extensions" tab and clicking on "Check for updates" and then "Apply and restart UI"), I've added an output_extension parameter, allowing you to define the expected output extension (without the leading dot).

Please note however that the JPG format cannot handle transparency as the PNG format does. Therefore, the foreground image will appear with a black background instead of a transparent background.

GenJiGu commented 1 month ago

Oh~, I see now. This is my first time using it, thank you for your patient guidance.