"black-forest-labs/FLUX.1-schnell-Free", "prompt" => $prompt, "width" => $image_width, "height" => $image_height, "steps" => 1, "n" => 1, "response_format" => "b64_json" ); $response = wp_remote_post($api_url, array( 'body' => wp_json_encode($response_body), 'headers' => array( 'Authorization' => 'Bearer ' . $api_key, 'Content-Type' => 'application/json', ), 'timeout' => 60, )); if (is_wp_error($response)) { return false; } $body = wp_remote_retrieve_body($response); // Decode the JSON response $result = json_decode($body, true); $b64image = $result['data'][0]['b64_json']; // Check if the 'image' field exists if (isset($b64image)) { return $b64image; } return false; }