Skip to content

Commit

Permalink
style: fix several code style lint error (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikoTan authored Aug 15, 2024
1 parent d15d6a6 commit 3fdf021
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,12 @@ export function apply(ctx: Context, config: Config) {
}
}
case 'comfyui': {
const workflowText2Image = config.workflowText2Image ? resolve(ctx.baseDir, config.workflowText2Image) : resolve(__dirname,'../data/default-comfyui-t2i-wf.json')
const workflowImage2Image = config.workflowImage2Image ? resolve(ctx.baseDir, config.workflowImage2Image) : resolve(__dirname,'../data/default-comfyui-i2i-wf.json')
const workflowText2Image = config.workflowText2Image
? resolve(ctx.baseDir, config.workflowText2Image)
: resolve(__dirname, '../data/default-comfyui-t2i-wf.json')
const workflowImage2Image = config.workflowImage2Image
? resolve(ctx.baseDir, config.workflowImage2Image)
: resolve(__dirname, '../data/default-comfyui-i2i-wf.json')
const workflow = image ? workflowImage2Image : workflowText2Image
logger.debug('workflow:', workflow)
const prompt = JSON.parse(await readFile(workflow, 'utf8'))
Expand All @@ -425,7 +429,7 @@ export function apply(ctx: Context, config: Config) {
let name = Date.now().toString()
const ext = mime === 'image/jpeg' ? 'jpg' : mime === 'image/png' ? 'png' : ''
if (ext) name += `.${ext}`
const imageFile = new Blob([image.buffer], {type:mime})
const imageFile = new Blob([image.buffer], { type: mime })
body.append("image", imageFile, name)
const res = await ctx.http(trimSlash(config.endpoint) + '/upload/image', {
method: 'POST',
Expand Down Expand Up @@ -477,7 +481,7 @@ export function apply(ctx: Context, config: Config) {
}
}
logger.debug('prompt:', prompt)
return { prompt }
return { prompt }
}
}
}
Expand Down

0 comments on commit 3fdf021

Please sign in to comment.