oobabooga / text-generation-webui

A Gradio web UI for Large Language Models.
GNU Affero General Public License v3.0
40.82k stars 5.34k forks source link

Character image resolution loss on loading character. #6502

Open dEATh-PM opened 3 weeks ago

dEATh-PM commented 3 weeks ago

Describe the bug

When a character is loaded and a PFP is generated in chat.py > generate_pfp_cache a thumbnail is generated as well. This thumbnail image is then returned back to state['character_picture'] for us in Gradio. When saving the character, state['character_picture'] is saved as the image parallel to the character .yaml, overwriting the original, and potentialy larger, image.

If this was the intended behavior, I would have assumed the down scaling would be performed when an image is initially imported.

https://github.com/oobabooga/text-generation-webui/blob/cc8c7ed2093cbc747e7032420eae14b5b3c30311/modules/chat.py#L721

Suggested sollution:

            return original_img

Is there an existing issue for this?

Reproduction

  1. Import a character with an image larger than 350x470
  2. Save character by pressing 💾

alt.

  1. Create a character with an image larger than 350x470
  2. Load character
  3. Save character by pressing 💾

Screenshot

No response

Logs

N/A

System Info

N/A