diff --git a/ui/media/js/main.js b/ui/media/js/main.js
index 08b53ebb..281f4b49 100644
--- a/ui/media/js/main.js
+++ b/ui/media/js/main.js
@@ -1446,12 +1446,12 @@ function createTask(task) {
if (task.reqBody.init_image !== undefined) {
let h = 80
let w = ((task.reqBody.width * h) / task.reqBody.height) >> 0
- taskConfig += `
`
+ taskConfig += ``
}
if (task.reqBody.control_image !== undefined) {
let h = 80
let w = ((task.reqBody.width * h) / task.reqBody.height) >> 0
- taskConfig += ``
+ taskConfig += ``
}
taskConfig += `${createTaskConfig(task)}
`
@@ -1473,6 +1473,30 @@ function createTask(task) {
`
+ if (task.reqBody.init_image !== undefined || task.reqBody.control_image !== undefined) {
+ createInitImageHover(taskEntry)
+ }
+
+ if (task.reqBody.control_image !== undefined && task.reqBody.control_filter_to_apply !== undefined) {
+ let controlImagePreview = taskEntry.querySelector(".controlnet-img-preview > img")
+ let req = {
+ image: task.reqBody.control_image,
+ filter: task.reqBody.control_filter_to_apply,
+ model_paths: {},
+ filter_params: {},
+ }
+ req["model_paths"][task.reqBody.control_filter_to_apply] = task.reqBody.control_filter_to_apply
+ SD.filter(req).then(
+ (result) => {
+ console.log(result)
+ controlImagePreview.src = result.output[0]
+ let controlImageLargePreview = taskEntry.querySelector(".controlnet-img-preview .task-fs-initimage img")
+ controlImageLargePreview.src = controlImagePreview.src
+ },
+ (error) => console.log("filter error", error)
+ )
+ }
+
createCollapsibles(taskEntry)
let draghandle = taskEntry.querySelector(".drag-handle")
@@ -1503,10 +1527,6 @@ function createTask(task) {
startY = e.target.closest(".imageTaskContainer").offsetTop
})
- if (task.reqBody.init_image !== undefined || task.reqBody.control_image !== undefined) {
- createInitImageHover(taskEntry)
- }
-
task["taskStatusLabel"] = taskEntry.querySelector(".taskStatusLabel")
task["outputContainer"] = taskEntry.querySelector(".img-preview")
task["outputMsg"] = taskEntry.querySelector(".outputMsg")