Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/models/code/TextToImageCode.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ export default {
prompt: "cyberpunk cat",
};

const response = await env.AI.run(
const stream = await env.AI.run(
"${name}",
inputs
);

return new Response(response, {
headers: {
"content-type": "image/png",
"content-type": "image/jpg",
},
});
},
Expand Down
15 changes: 15 additions & 0 deletions src/content/docs/images/upload-images/upload-file-worker.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
pcx_content_type: how-to
title: Upload an image using a Worker

---

You can use a Worker to upload your image to Cloudflare Images.

Refer to the example below or refer to the [Workers documentation](/workers/) for more information.

```ts
const image = await fetch("./myimage.png");
const bytes = await image.bytes();
formData.append('file', new File([bytes], 'myimage.png');
```