From 17e848f84704bbc71fa46b9afb0c77e14ba6f243 Mon Sep 17 00:00:00 2001 From: Yaohui Wu Date: Thu, 30 May 2024 15:38:41 +0800 Subject: [PATCH 1/2] Fixed the docker build error 'ERROR: failed to solve: cannot copy to non-directory' caused by the 'COPY . .' command --- .dockerignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..b512c09d --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file From 69f660263dcb0e7cfb02d7add321c9cc0faf1004 Mon Sep 17 00:00:00 2001 From: Yaohui Wu Date: Thu, 30 May 2024 15:41:54 +0800 Subject: [PATCH 2/2] Allow uploading the refered image when generating an image from an image. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The step is: 1.Upload two images; 2.Change the mode to Mat map(垫图); 3.Input the commond: /mj Maternity Dress, front view, soild white background, simplified details, vector style --sref Note: the command must end with '--sref' --- app/core/midjourney.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/core/midjourney.ts b/app/core/midjourney.ts index 8b6fbc9c..081df07a 100644 --- a/app/core/midjourney.ts +++ b/app/core/midjourney.ts @@ -56,6 +56,15 @@ export class MidjourneyApi { const uploadRes: any = await this.uploadImage(data.images[0], true) prompt = uploadRes.url + " " + prompt } + if (((data.images?.length || 0) > 1)) { + const promptTmp = (prompt as string).trimEnd() + if (promptTmp.endsWith('--sref')) { + // upload the second image + const uploadRes2: any = await this.uploadImage(data.images[1], true) + console.log('The second image was uploaded successfully. Url = ' + uploadRes2.url) + prompt = promptTmp + " " + uploadRes2.url + } + } this.taskCall(taskId, this.client?.Imagine( prompt, this.taskLoading(taskId)