oobabooga / text-generation-webui

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

Character images in selector #128

Closed Slug-Cat closed 1 year ago

Slug-Cat commented 1 year ago

A feature I particularly like in TavernAI is the presence of accompanying images for characters who have them in the selection menu. I don't know how this would work with Gradio, but it would be quite convenient when searching through the long list of names without referring back to the images in the character folder.

oobabooga commented 1 year ago

It should be possible to create an extension that shows a table with the characters and their images using an HTML gradio element. That would be pretty cool.

It wouldn't be selectable though.

https://github.com/oobabooga/text-generation-webui/wiki/Extensions

oobabooga commented 1 year ago

Here it is. It doesn't do anything, but it at least gives a reference for each character. Use with

--extensions gallery

Source: https://github.com/oobabooga/text-generation-webui/blob/main/extensions/gallery/script.py

print

Slug-Cat commented 1 year ago

Here it is. It doesn't do anything, but it at least gives a reference for each character. Use with

--extensions gallery

Source: https://github.com/oobabooga/text-generation-webui/blob/main/extensions/gallery/script.py

print

Neato. Not exactly what I had in mind, but it serves the same purpsoe well enough. Thanks.

oobabooga commented 1 year ago

The elements are clickable now too.

https://github.com/oobabooga/text-generation-webui/commit/7a776ccf8715bbe4e6934772fd135d54e4d24f78