Allow PNG-RGBA for Extras Tab
diff --git a/modules/postprocessing.py b/modules/postprocessing.py
index 754cc9e3ab2..7685e925896 100644
--- a/modules/postprocessing.py
+++ b/modules/postprocessing.py
@@ -66,7 +66,7 @@ def get_images(extras_mode, image, image_folder, input_dir):
         if parameters:
             existing_pnginfo["parameters"] = parameters
 
-        initial_pp = scripts_postprocessing.PostprocessedImage(image_data.convert("RGB"))
+        initial_pp = scripts_postprocessing.PostprocessedImage(image_data.convert("RGBA")) if image_data.mode == "RGBA" else scripts_postprocessing.PostprocessedImage(image_data.convert("RGB"))
 
         scripts.scripts_postproc.run(initial_pp, args)
 
diff --git a/modules/ui_postprocessing.py b/modules/ui_postprocessing.py
index 7261c2df8a0..dc08350d126 100644
--- a/modules/ui_postprocessing.py
+++ b/modules/ui_postprocessing.py
@@ -12,7 +12,7 @@ def create_ui():
         with gr.Column(variant='compact'):
             with gr.Tabs(elem_id="mode_extras"):
                 with gr.TabItem('Single Image', id="single_image", elem_id="extras_single_tab") as tab_single:
-                    extras_image = gr.Image(label="Source", source="upload", interactive=True, type="pil", elem_id="extras_image")
+                    extras_image = gr.Image(label="Source", source="upload", interactive=True, type="pil", elem_id="extras_image", image_mode="RGBA")
 
                 with gr.TabItem('Batch Process', id="batch_process", elem_id="extras_batch_process_tab") as tab_batch:
                     image_batch = gr.Files(label="Batch Process", interactive=True, elem_id="extras_image_batch")
diff --git a/scripts/postprocessing_codeformer.py b/scripts/postprocessing_codeformer.py
index e1e156ddcaa..53a0cc44cde 100644
--- a/scripts/postprocessing_codeformer.py
+++ b/scripts/postprocessing_codeformer.py
@@ -25,7 +25,7 @@ def process(self, pp: scripts_postprocessing.PostprocessedImage, enable, codefor
         if codeformer_visibility == 0 or not enable:
             return
 
-        restored_img = codeformer_model.codeformer.restore(np.array(pp.image, dtype=np.uint8), w=codeformer_weight)
+        restored_img = codeformer_model.codeformer.restore(np.array(pp.image.convert("RGB"), dtype=np.uint8), w=codeformer_weight)
         res = Image.fromarray(restored_img)
 
         if codeformer_visibility < 1.0:
diff --git a/scripts/postprocessing_gfpgan.py b/scripts/postprocessing_gfpgan.py
index 6e7566055d2..57e3623995c 100644
--- a/scripts/postprocessing_gfpgan.py
+++ b/scripts/postprocessing_gfpgan.py
@@ -22,7 +22,7 @@ def process(self, pp: scripts_postprocessing.PostprocessedImage, enable, gfpgan_
         if gfpgan_visibility == 0 or not enable:
             return
 
-        restored_img = gfpgan_model.gfpgan_fix_faces(np.array(pp.image, dtype=np.uint8))
+        restored_img = gfpgan_model.gfpgan_fix_faces(np.array(pp.image.convert("RGB"), dtype=np.uint8))
         res = Image.fromarray(restored_img)
 
         if gfpgan_visibility < 1.0:

## Description

Hello guys!
There's a small issue when we want to swap a face to PNG images (with RGBA) - (in particular via ReActor)
By default SD WebUI cuts Alpha-channel when we postprocess the image via the Extras Tab

E.g.:
I load the image with transparency and want to swap the face
So I get the following result:

![image](https://github.com/lllyasviel/stable-diffusion-webui-forge/assets/85128026/591b0a5e-fa34-450c-8a79-34d0fcefc9cf)
![image](https://github.com/lllyasviel/stable-diffusion-webui-forge/assets/85128026/36611231-83ba-46f2-afae-dc92c69e0cb2)

As we can see the alpha channel is lost

With this little fix we can operate with all 4 channels of the input image - and the result is:

![image](https://github.com/lllyasviel/stable-diffusion-webui-forge/assets/85128026/128162bf-d961-47a9-976c-ff1eea8acd12)
![image](https://github.com/lllyasviel/stable-diffusion-webui-forge/assets/85128026/b87c1c2f-5dbc-4372-bdb3-1477e0c9879f)

## Screenshots/videos:

![image](https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/85128026/c6770898-0a87-4462-9a96-3649293c5cab)

## Additional information

Related Issue: https://github.com/Gourieff/sd-webui-reactor/issues/382

## Checklist:

- [x] I have read [contributing wiki page](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing)
- [x] I have performed a self-review of my own code
- [x] My code follows the [style guidelines](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing#code-style)
- [x] My code passes [tests](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Tests)
