lllyasviel / lllyasviel/stable-diffusion-webui-forge

[Feature Request]: Allow PNG-RGBA for Extras Tab

Open
#516 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
13k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What would your feature do ?

Hello guys!
There's a small issue when I want to swap a face to PNG images (with RGBA)
By default SD WebUI cuts Alpha-channel when you postprocess the image via 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](https://github.com/lllyasviel/stable-diffusion-webui-forge/compare/main...Gourieff:stable-diffusion-webui-forge:extras--allow-png-rgba) 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)

If there's no any other specific reason to convert the input to the RGB for Extras (except RGB mode needs for restorers) - I can add the PR

### Proposed workflow

1. Go to the Extras Tab
2. Load PNG (of some person) with transparency
3. Try to swap the face via ReActor
4. Get the result with transparency as well

### Additional information

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the linked compare for the Extras Tab and trace the image-processing path used by the ReActor face-swap workflow. Reproduce the proposed workflow with a transparent PNG, then verify that the completed result preserves its alpha channel while remaining compatible with the relevant restorers.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.