We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e79f024 commit 96bf977Copy full SHA for 96bf977
src/content/changelog/workers-ai/2025-11-25-flux-2-dev-workers-ai.mdx
@@ -89,6 +89,20 @@ curl --request POST \
89
Through Workers AI Binding:
90
91
```javascript
92
+//helper function to convert ReadableStream to Blob
93
+async function streamToBlob(stream: ReadableStream, contentType: string): Promise<Blob> {
94
+ const reader = stream.getReader();
95
+ const chunks = [];
96
+
97
+ while (true) {
98
+ const { done, value } = await reader.read();
99
+ if (done) break;
100
+ chunks.push(value);
101
+ }
102
103
+ return new Blob(chunks, { type: contentType });
104
+}
105
106
const image0 = await fetch("http://image-url");
107
const image1 = await fetch("http://image-url");
108
const form = new FormData();
0 commit comments