Design pattern for PyQt5 plugin marketplace,and stable diffusion [closed]

I am building a project using PyQt5. The client-side of this project will be a toolbox that contains various Python scripts or deep learning components. I would like to turn them into plugins. For running deep learning-related tasks, I plan to use Gradio to build a web interface or an RPC framework. Both of these will be designed as remote invocation servers.

I hope to design these plugins similar to the plugin marketplace in Obsidian, where I can also perform hot updates on the client-side. Currently, I have designed a simple UI using PyQt5, which is a composite widget representing a plugin. It consists of a large label and a small label. The large label will serve as a one-click activation button for the plugin, while the small label will trigger a dialog through a signal-slot connection. The dialog will allow me to configure the plugin, such as providing a description and specifying the path to save the plugin’s output data.

The problem I am facing is that I am not very familiar with Python development, and I am unsure which design pattern would be suitable for designing this composite widget. I anticipate that I will need to customize a large number of plugins, and the dialogs triggered by the small labels of these plugins will differ. Additionally, the actions performed by the large labels may vary, such as running a local script or opening a pre-deployed web interface. I even hope to have a JSON file to store the names and images of these plugins.

My first question is, what design pattern should I use to design this plugin marketplace and standardize the code for these plugins?

My second question is, I have deployed a stable Diffusion web UI on my server. I would like one of the plugin dialogs to save different parameters, and when I click a button in the dialog, it should open the SDweb with the specified parameters.

Thirdly, is there a similar design on GitHub that I can leverage, so I don’t have to reinvent the wheel?

Leave a Comment