+
+ Generate Image
+
+
+
+
+
+
+
+
+
+
+
+
+ setImageGenN(parseInt(e.target.value))
}
- const resp: ImageResponse[] = (
- await fetch(ctx.chatStore.image_gen_api, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- Authorization: `Bearer ${ctx.chatStore.image_gen_key}`,
- },
- body: JSON.stringify(body),
- }).then((resp) => resp.json())
- ).data;
- console.log("image gen resp", resp);
-
- for (const image of resp) {
- let url = "";
- if (image.url) url = image.url;
- if (image.b64_json)
- url = "data:image/png;base64," + image.b64_json;
- if (!url) continue;
-
- ctx.chatStore.history.push({
- role: "assistant",
- content: [
- {
- type: "image_url",
- image_url: {
- url,
- detail: "low",
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+ for (const image of resp) {
+ let url = "";
+ if (image.url) url = image.url;
+ if (image.b64_json)
+ url = "data:image/png;base64," + image.b64_json;
+ if (!url) continue;
-
-
-
-
-