-
Notifications
You must be signed in to change notification settings - Fork 35
Contributing ‐ Extensions
Ilian Iliev edited this page May 6, 2024
·
1 revision
If you have some coding skills and if you want to contribute to this project, you can follow this short guide.
You can check state.ext.control-net.js for reference. The idea is:
- Create your js file state.ext.{your-extension-name}.js in /javascript It must contain IIFE with the init method like so:
window.state = window.state || {};
window.state.extensions = window.state.extensions || {};
state = window.state;
state.extensions['{your-extension-name}'] = (function () {
function init() {
}
return { init };
})();
- Add the extension to state_settings.py -> state_extensions in order to see it in Web UI settings Inspect the inputs you want to save to check element ids. The best case is if there is id and it contains txt2img/img2img part. If not, the element must be selected relatively from another element (container). For more complicated elements (selects, multiple selects) with custom structure, coming from gradio, you can use the functions in state.utils.js.
I hope this helps. Feel free to ask anything else in the Discussions. If you manage to handle some extension you can always push your changes to PR! :)