(req, img, reqDiff)
| 910 | }) |
| 911 | |
| 912 | function enqueueImageVariationTask(req, img, reqDiff) { |
| 913 | const imageSeed = img.getAttribute("data-seed") |
| 914 | |
| 915 | const newRequestBody = { |
| 916 | num_outputs: 1, // this can be user-configurable in the future |
| 917 | seed: imageSeed, |
| 918 | } |
| 919 | |
| 920 | // If the user is editing pictures, stop modifyCurrentRequest from importing |
| 921 | // new values by setting the missing properties to undefined |
| 922 | if (!("init_image" in req) && !("init_image" in reqDiff)) { |
| 923 | newRequestBody.init_image = undefined |
| 924 | newRequestBody.mask = undefined |
| 925 | } else if (!("mask" in req) && !("mask" in reqDiff)) { |
| 926 | newRequestBody.mask = undefined |
| 927 | } |
| 928 | |
| 929 | const newTaskRequest = modifyCurrentRequest(req, reqDiff, newRequestBody) |
| 930 | newTaskRequest.numOutputsTotal = 1 // this can be user-configurable in the future |
| 931 | newTaskRequest.batchCount = 1 |
| 932 | |
| 933 | createTask(newTaskRequest) |
| 934 | } |
| 935 | |
| 936 | function applyInlineFilter(filterName, path, filterParams, img, statusText, tools) { |
| 937 | const filterReq = { |
no test coverage detected