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] width or height can not be 608 #44

Closed
FNsi opened this issue Sep 4, 2023 · 6 comments
Closed

[Bug] width or height can not be 608 #44

FNsi opened this issue Sep 4, 2023 · 6 comments

Comments

@FNsi
Copy link

FNsi commented Sep 4, 2023

GGML_Assert ggml.c 5733 a->ne[0] .....

@leejet
Copy link
Owner

leejet commented Sep 4, 2023

The height and width should be multiples of 64. I have updated the prompt for the command line parameters

@FNsi
Copy link
Author

FNsi commented Sep 4, 2023

The height and width should be multiples of 64. I have updated the prompt for the command line parameters

Nice work🙏

@dmikey
Copy link
Contributor

dmikey commented Sep 4, 2023

Shouldn't they be multiples of 8?

504x520 is a valid dimension in other SD pipelines.

@leejet
Copy link
Owner

leejet commented Sep 4, 2023

Shouldn't they be multiples of 8?

504x520 is a valid dimension in other SD pipelines.

The sd diffusion process run in the latent space of 1/8 of the width and height. In addition, unet will downsample the middle layer to 1/8 during the operation, so in fact the middle layer size will be 1/64 of width and height, which is why sd.cpp requires width and height to be multiples of 64.

If "sd" were to scale the latent space to a multiple of 8 before U-Net computation and then restore it to its original size afterward, it would indeed allow input widths and heights to be multiples of 8. However, I have not implemented it yet.

@FNsi FNsi closed this as completed Sep 4, 2023
@rootgrandfather
Copy link

Is there any plan to implement this feature?

@stduhpf
Copy link
Contributor

stduhpf commented Oct 4, 2024

Is there any plan to implement this feature?

This already works for Flux and SD3 models if you bypass the part that sanitizes the cli arguments.

For example, if you use the server example (#367) , you can set the width and height in the json payload, and the values aren't being checked. (this causes crashes with Unet-based models btw)

json payload : {'prompt':""" Two kittens (a black one and a white one) holding together a large sign that says "Flux.cpp works in 720p!", they are on either side of the sign. There are out of focus balls of wool in the background.""",'height':720, 'width':1280, 'seed':42})
test

Or, more relevant to the issue:
test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants