YouTube wants JPG or PNG; Recraft V4 on Sume returns WebP only
YouTube's thumbnail page names JPG or PNG. Recraft V4 on Sume lists only WebP, so convert it with Pillow and stay under the 2 MB mobile cap.
If you generate a YouTube thumbnail with Recraft V4 on Sume, you will get a WebP file, because that is the only output format the model lists in Sume's catalog. YouTube's thumbnail help page names JPG or PNG as its example formats, so convert the WebP to JPEG (or PNG) yourself before you upload, and check the size against the 2 MB mobile limit.
This is a small mismatch but a real one: the thumbnail looks fine in a browser, and the problem only shows up at the upload step. The fix is a few lines of Pillow, shown below.
What each side says
On the YouTube side, the page describes thumbnails for videos, Shorts and podcasts, and says the supported image formats are things like JPG or PNG. It also sets 2 MB as the limit for video thumbnails uploaded on mobile, and 50 MB on desktop for video, Shorts and podcast thumbnails. WebP is not named in the text I read, so I would not rely on it being accepted.
On the Sume side, the Image API docs say each model's output_format descriptor is published in the catalog, and that a parameter a model does not list is rejected with 400 unsupported_parameter rather than ignored. In Sume's catalog row for Recraft V4 the only listed output format is webp, the model is text-to-image only, and it does not accept reference images. The fal page for the model lists $0.04 per image and describes it as production-ready for brand systems; it does not describe a JPG option.
| Model | Formats you can request | Notes |
|---|---|---|
| Recraft V4 | webp only | text-to-image only |
| ChatGPT Image 2.5, Nano Banana 2 and Pro, Seedream, Flux 2, Qwen Image | png, jpeg, webp | pick jpeg for YouTube |
| Ideogram 4.5 | none listed | output format is chosen by the provider |
| Higgsfield Soul | none listed | docs describe PNG, chosen by the provider |
Convert and shrink in one pass
Sume's docs also say output_compression (0 to 100 for JPEG and WebP) is in the schema but not served in v1, so you cannot ask the API to compress for you. Compression is therefore your step. The function below downloads the Sume-hosted image, flattens it to RGB, and tries JPEG qualities from 92 down to 60 until the bytes fit under 2,000,000, which is slightly under 2 MB so you do not argue about whether a megabyte is 1,000,000 or 1,048,576 bytes. If nothing fits, it raises, and the right response is to resize rather than to drop quality further.
import io
import requests
from PIL import Image
def webp_to_jpeg(url, limit=2_000_000):
raw = requests.get(url, timeout=60).content
img = Image.open(io.BytesIO(raw)).convert("RGB")
for quality in (92, 85, 78, 70, 60):
buf = io.BytesIO()
img.save(buf, "JPEG", quality=quality, optimize=True)
if buf.tell() <= limit:
return buf.getvalue(), quality
raise ValueError("still over the limit: resize first")
# url = the data[0]["url"] from your Recraft V4 response
# jpeg, quality = webp_to_jpeg(url)
# open("thumb.jpg", "wb").write(jpeg)Or pick a model that already returns JPEG
If the look you need does not depend on Recraft, the simplest route is a model whose descriptor lists jpeg. Request it with output_format: "jpeg" and skip the conversion. Read supported_parameters from GET /v1/images/models first, as the docs advise, rather than assuming a format is available.
Download the image soon after generation, too. Sume returns Sume-hosted URLs rather than inline base64, so keep your converted JPEG as the file you actually publish.
Whichever route you take, open the final file once at its real upload size. A WebP-to-JPEG conversion can band in smooth gradients at the lower qualities, and a thumbnail with large flat color areas shows that first. If you see it, resize the image slightly smaller and keep the quality higher instead of the reverse.
Sources
Related posts
More in Media tools
- YouTube video blurry after upload? Wait for HD, then check the file
YouTube Help says HD and 4K take longer to process and Studio shows the estimate. Check the Sume file's size with video-inspect before you blame processing.
- YouTube .vtt: positioning yes, styling only b/i/u. Sume design options
YouTube's .vtt support allows positioning but limits styling to bold, italic and underline. Sume burns richer styling; see which route fits your look.
- How to assemble a long-form video with the Timeline 1.0 API
Timeline 1.0 renders one audio spine plus 1 to 200 ordered video slots into one MP4. Every URL must be Sume-hosted; the plan preflight is unbilled.
- How to burn captions onto a video with the Sume API
Send a public HTTPS video URL to POST /v1/video-captions and get a job-backed captioned video, timed by speech-to-text or by text you supply.
Written by Sume