mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-30 22:50:51 +02:00
UI-side plugin system; Use PLUGINS['IMAGE_INFO_BUTTONS'] to add additional buttons on the generated images
This commit is contained in:
23
ui/media/js/plugins.js
Normal file
23
ui/media/js/plugins.js
Normal file
@ -0,0 +1,23 @@
|
||||
const PLUGIN_API_VERSION = "1.0"
|
||||
|
||||
const PLUGINS = {
|
||||
/**
|
||||
* Register new buttons to show on each output image.
|
||||
*
|
||||
* Example:
|
||||
* PLUGINS['IMAGE_INFO_BUTTONS']['myCustomVariationButton'] = {
|
||||
* text: 'Make a Similar Image',
|
||||
* on_click: function(origRequest, image) {
|
||||
* let newTaskRequest = getCurrentUserRequest()
|
||||
* newTaskRequest.reqBody = Object.assign({}, origRequest, {
|
||||
* init_image: image.src,
|
||||
* prompt_strength: 0.7,
|
||||
* seed: Math.floor(Math.random() * 10000000)
|
||||
* })
|
||||
* newTaskRequest.seed = newTaskRequest.reqBody.seed
|
||||
* createTask(newTaskRequest)
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
IMAGE_INFO_BUTTONS: {}
|
||||
}
|
Reference in New Issue
Block a user