Skip to content

Error generating images with workers-ai-provider #272

@notreux

Description

@notreux

I'm getting an error when using workers-ai-provider, even though the same request works fine when made manually with axios using the same API key and account ID

Environment

  • Runtime: Bun 1.2.21
  • OS: Windows 11 Pro (23H2)

Example:

const { image } = await generateImage({
	model: workersai.image('@cf/black-forest-labs/flux-1-schnell'),
	prompt: 'A futuristic cityscape at sunset',
});

Error:

13419 |   } else if (stream2 && typeof stream2.arrayBuffer === "function") {
13423 |   } else {
13424 |     throw new Error("Unsupported stream type: expected a Web ReadableStream or an async iterable stream");
                  ^
error: Unsupported stream type: expected a Web ReadableStream or an async iterable stream
      at streamToUint8Array (C:\Users\Reux\Documents\Develop\Project\node_modules\workers-ai-provider\dist\index.js:13424:11)      
      at streamToUint8Array (C:\Users\Reux\Documents\Develop\Project\node_modules\workers-ai-provider\dist\index.js:13380:35) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions