fix: align image dimensions to FLUX.1 divisible-by-8 requirement
FLUX.1 schnell requires width and height to be divisible by 8. The default OG image size 1200×630 has 630 % 8 = 6 remainder, causing HTTP 400 on every image generation call. Changes: - Pipeline default height 630 → 632 (nearest 8-aligned value) - Provider now rounds any dimension to nearest multiple of 8 as a defensive guard before sending to the API Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -69,6 +69,10 @@ class PRAutoBlogger_Cloudflare_Image_Provider implements PRAutoBlogger_Image_Pro
|
||||
* @throws \RuntimeException On auth failure, bad response shape, or retry exhaustion.
|
||||
*/
|
||||
public function generate_image( string $prompt, int $width, int $height, array $options = [] ): array {
|
||||
// FLUX.1 requires dimensions divisible by 8; round to nearest valid value.
|
||||
$width = (int) ( round( $width / 8 ) * 8 );
|
||||
$height = (int) ( round( $height / 8 ) * 8 );
|
||||
|
||||
$this->assert_valid_dimensions( $width, $height );
|
||||
$prompt = trim( $prompt );
|
||||
if ( '' === $prompt ) {
|
||||
|
||||
Reference in New Issue
Block a user