gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
33.43k stars 2.53k forks source link

[feature request] WebGL Canvas component #7649

Closed Vipitis closed 7 months ago

Vipitis commented 7 months ago

Describe the solution you'd like
I am working on a space that let's the user use language models to assist in coding fragment shaders. It would be great to have a component available that renders the result on the client.
Currently I either render individual frames on the backend and use the image component, or some janky iFrame. example1 exmaple2. It would be lovely to have a component that simply takes valid glsl as a string. Optionally there could be controls like a pause/resume button, save screenshot, and maybe even something like mouse location.

I don't believe there is much use so it seems like a custom component to me. I got zero webdev experience myself, so it will be low priority. Perhaps you an still share any pointers if this is tagged as not planned in the end

abidlabs commented 7 months ago

Hi @Vipitis this is super interesting. I do agree that its quite niche and would probably serve best as a custom component at this point for maintainability reasons. I actually think this would be a great use case for a custom component!

If you'd like to create your own, we've put together a Guide: https://www.gradio.app/guides/five-minute-guide, and we're happy to help (I'll go ahead and close this issue, but still feel free to ask any questions here).