mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-03-26 06:49:42 +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
|
||||
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) {
|
||||
instance = factory(newTaskReqBody)
|
||||
instance = factory(eventInfo.reqBody || newTaskReqBody)
|
||||
}
|
||||
if (!instance) {
|
||||
console.error(`${factory ? "Factory " + String(factory) : 'No factory defined'} for output format ${newTaskReqBody.output_format}. Instance is ${instance || 'undefined'}. Using default renderer.`)
|
||||
instance = new SD.RenderTask(newTaskReqBody)
|
||||
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(eventInfo.reqBody || newTaskReqBody)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user