2022-10-19 16:20:05 +02:00
|
|
|
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)
|
2022-10-19 16:40:45 +02:00
|
|
|
* },
|
|
|
|
* filter: function(origRequest, image) {
|
|
|
|
* // this is an optional function. return true/false to show/hide the button
|
|
|
|
* // if this function isn't set, the button will always be visible
|
|
|
|
* return true
|
2022-10-19 16:20:05 +02:00
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*/
|
|
|
|
IMAGE_INFO_BUTTONS: {}
|
|
|
|
}
|