mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-03-29 08:36:46 +01:00
Use the reqBody exposed to events to allow plugins to change the request. (#620)
This commit is contained in:
parent
7984327d81
commit
1283c6483d
@ -705,13 +705,13 @@ function onTaskStart(task) {
|
|||||||
})
|
})
|
||||||
let instance = eventInfo.instance
|
let instance = eventInfo.instance
|
||||||
if (!instance) {
|
if (!instance) {
|
||||||
const factory = PLUGINS.OUTPUTS_FORMATS.get(newTaskReqBody.output_format)
|
const factory = PLUGINS.OUTPUTS_FORMATS.get(eventInfo.reqBody?.output_format || newTaskReqBody.output_format)
|
||||||
if (factory) {
|
if (factory) {
|
||||||
instance = factory(newTaskReqBody)
|
instance = factory(eventInfo.reqBody || newTaskReqBody)
|
||||||
}
|
}
|
||||||
if (!instance) {
|
if (!instance) {
|
||||||
console.error(`${factory ? "Factory " + String(factory) : 'No factory defined'} for output format ${newTaskReqBody.output_format}. Instance is ${instance || 'undefined'}. Using default renderer.`)
|
console.error(`${factory ? "Factory " + String(factory) : 'No factory defined'} for output format ${eventInfo.reqBody?.output_format || newTaskReqBody.output_format}. Instance is ${instance || 'undefined'}. Using default renderer.`)
|
||||||
instance = new SD.RenderTask(newTaskReqBody)
|
instance = new SD.RenderTask(eventInfo.reqBody || newTaskReqBody)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user