mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-03-29 00:26:26 +01:00
Add a button to fix faces on generated images
This commit is contained in:
parent
8d8c932d8c
commit
48b7b725b0
@ -370,7 +370,8 @@ function showImages(reqBody, res, outputContainer, livePreview) {
|
|||||||
{ text: 'Use as Input', on_click: onUseAsInputClick },
|
{ text: 'Use as Input', on_click: onUseAsInputClick },
|
||||||
{ text: 'Download', on_click: onDownloadImageClick },
|
{ text: 'Download', on_click: onDownloadImageClick },
|
||||||
{ text: 'Make Similar Images', on_click: onMakeSimilarClick },
|
{ text: 'Make Similar Images', on_click: onMakeSimilarClick },
|
||||||
{ text: 'Upscale', on_click: onUpscaleClick, filter: (req, img) => !req.use_upscale }
|
{ text: 'Upscale', on_click: onUpscaleClick, filter: (req, img) => !req.use_upscale },
|
||||||
|
{ text: 'Fix Faces', on_click: onFixFacesClick, filter: (req, img) => !req.use_face_correction }
|
||||||
]
|
]
|
||||||
|
|
||||||
// include the plugins
|
// include the plugins
|
||||||
@ -464,6 +465,24 @@ function onUpscaleClick(req, img) {
|
|||||||
createTask(newTaskRequest)
|
createTask(newTaskRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onFixFacesClick(req, img) {
|
||||||
|
let newTaskRequest = getCurrentUserRequest()
|
||||||
|
const imageSeed = img.getAttribute('data-seed')
|
||||||
|
|
||||||
|
newTaskRequest.reqBody = Object.assign({}, req, {
|
||||||
|
num_outputs: 1,
|
||||||
|
use_cpu: useCPUField.checked,
|
||||||
|
use_face_correction: 'GFPGANv1.3',
|
||||||
|
seed: imageSeed
|
||||||
|
})
|
||||||
|
|
||||||
|
newTaskRequest.numOutputsTotal = 1
|
||||||
|
newTaskRequest.batchCount = 1
|
||||||
|
newTaskRequest.seed = newTaskRequest.reqBody.seed
|
||||||
|
|
||||||
|
createTask(newTaskRequest)
|
||||||
|
}
|
||||||
|
|
||||||
// makes a single image. don't call this directly, use makeImage() instead
|
// makes a single image. don't call this directly, use makeImage() instead
|
||||||
async function doMakeImage(task) {
|
async function doMakeImage(task) {
|
||||||
if (task.stopped) {
|
if (task.stopped) {
|
||||||
|
Loading…
Reference in New Issue
Block a user