1
This commit is contained in:
parent
6e8e89b624
commit
75d476b155
@ -59,25 +59,29 @@ export default {
|
|||||||
response_format,
|
response_format,
|
||||||
} = request.body;
|
} = request.body;
|
||||||
const responseFormat = _.defaultTo(response_format, "url");
|
const responseFormat = _.defaultTo(response_format, "url");
|
||||||
const imageUrls = await generateImages('jimeng-3.1', task_id, prompt, {
|
generateImages('jimeng-3.1', task_id, prompt, {
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
sampleStrength:0.5,
|
sampleStrength:0.5,
|
||||||
negativePrompt:"",
|
negativePrompt:"",
|
||||||
}, token);
|
}, token);
|
||||||
let data = [];
|
// let data = [];
|
||||||
if (responseFormat == "b64_json") {
|
// if (responseFormat == "b64_json") {
|
||||||
data = (
|
// data = (
|
||||||
await Promise.all(imageUrls.map((url) => util.fetchFileBASE64(url)))
|
// await Promise.all(imageUrls.map((url) => util.fetchFileBASE64(url)))
|
||||||
).map((b64) => ({ b64_json: b64 }));
|
// ).map((b64) => ({ b64_json: b64 }));
|
||||||
} else {
|
// } else {
|
||||||
data = imageUrls.map((url) => ({
|
// data = imageUrls.map((url) => ({
|
||||||
url,
|
// url,
|
||||||
}));
|
// }));
|
||||||
}
|
// }
|
||||||
|
// return {
|
||||||
|
// created: util.unixTimestamp(),
|
||||||
|
// data,
|
||||||
|
// };
|
||||||
return {
|
return {
|
||||||
created: util.unixTimestamp(),
|
created: util.unixTimestamp(),
|
||||||
data,
|
data:'success',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user