Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] sometimes generates invalid images? #101

Open
Butterroach opened this issue Jul 9, 2024 · 10 comments
Open

[bug] sometimes generates invalid images? #101

Butterroach opened this issue Jul 9, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@Butterroach
Copy link
Member

image

?????????

@Butterroach Butterroach added the bug Something isn't working label Jul 9, 2024
@Butterroach
Copy link
Member Author

image

@Butterroach
Copy link
Member Author

image
the one with 121 bytes actually has plain text which isnt image

@Butterroach
Copy link
Member Author

idk what's going on with the second one

@lordsirggg

This comment was marked as off-topic.

@Butterroach
Copy link
Member Author

someone please work on this!#!@#!@#!@#!@#!@#!@#!@#!@#!@#!

@lordsirggg

This comment was marked as off-topic.

@artifishvr
Copy link
Collaborator

what if here

const imageGen = await this.response.generateImage({ data: genData }).catch((e) => {

we check if cloudflare actually returned a success in their response (https://developers.cloudflare.com/api/operations/workers-ai-post-run-cf-stabilityai-stable-diffusion-xl-base-1-0)

@artifishvr
Copy link
Collaborator

like adding

if (!imageGen.success) return await responseMsg.edit({ content: textResponse }).catch(() => null);

@Butterroach
Copy link
Member Author

and also check if the image isnt just an 8kb file of mostly null bytes

image

@daniwasonline
Copy link
Collaborator

what if here

const imageGen = await this.response.generateImage({ data: genData }).catch((e) => {

we check if cloudflare actually returned a success in their response (https://developers.cloudflare.com/api/operations/workers-ai-post-run-cf-stabilityai-stable-diffusion-xl-base-1-0)

i'll implement this check in the imagine integration, this'll eventually roll down to legacy at some point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants