This is a single-file Open WebUI pipe that lets you generate images (text → image) and edit images (image + text → image) using ByteDance Seedream via an API gateway.
- Pipe file:
bytedance_seedream.py - Pipe ID:
seedream-4-5 - What you get back: Markdown image links to files stored in Open WebUI.
In Open WebUI, choose the tool named ByteDance: Seedream (ID seedream-4-5) for your chat/message.
Send help to the tool to get a short usage guide with examples and supported sizes.
This tool may slightly rewrite/clean up your prompt before generating, and it will show you the exact “Using prompt” text in the chat.
If you don’t want any rewriting, add this to your message:
Use my prompt verbatim. Don’t embellish or expand it.
Type what you want and send it.
Good prompt examples:
- “A cinematic photo of a black cat in the rain, 85mm lens, soft bokeh, night city lights.”
- “A minimal flat icon of a rocket, white background, simple shapes.”
- “A watercolor landscape with mountains and a lake, pastel colors.”
If you want a specific size, say it explicitly:
- “Generate a poster at 4096x4096 …”
- “Make it 2048x2048 …”
- “Use 2K / 4K …”
Attach an image to your message and describe the edit.
Edit prompt examples:
- “Remove the watermark and make the background white.”
- “Change the car color to red and keep the same angle.”
- “Make the sky sunset orange, keep the building unchanged.”
- “Upscale to 2048x2048 and sharpen slightly.”
Notes:
- If you don’t request a resize, the pipe tries to keep the original image dimensions for edits.
- If you attach multiple images, the pipe will decide which ones are references and which one is the “base” image to edit.
You’ll get one or more generated images as Markdown image links that you can click/open in Open WebUI.
Common user-visible issues:
- “API_KEY not set in valves.” → ask your admin to configure the pipe.
- “No Task Model configured …” → ask your admin to configure Open WebUI’s Task Model (see Admin section).
- Gateway/API errors → try again later or ask your admin to check the provider status/limits.
- Collects the user conversation and any attached images.
- Uses Open WebUI’s global Task Model to classify intent (generate vs edit) and to extract parameters (size, watermark preference, image usage plan).
- Calls the image API endpoint for either generation or editing.
- Uploads the returned images into the Open WebUI file store.
- Streams an OpenAI-compatible response to the UI with status updates.
- Copy
bytedance_seedream.pyinto your Open WebUI backendpipes/directory. - Restart Open WebUI.
Set valves in the Open WebUI plugin UI:
API_KEY(string, required): API bearer token for your image gateway/provider.API_BASE_URL(string): defaults tohttps://api.cometapi.com/v1.MODEL(string): defaults todoubao-seedream-4-5-251128(update this when your provider changes model identifiers).
This pipe uses Open WebUI’s global Task Model configuration:
TASK_MODEL_EXTERNAL(recommended) orTASK_MODEL
Your task model must support Structured Outputs (JSON Schema). If it doesn’t, the task-model step will fail and the pipe will error.
Pipe valves related to task model selection:
task_model_mode: chooseexternal(usesTASK_MODEL_EXTERNAL) orinternal(usesTASK_MODEL)task_model_fallback: fallback strategy if the task model call fails (none,other_task_model,chat_model)
ENABLE_LOGGING(bool): whenTrue, logs at INFO; otherwise only errors.GUIDANCE_SCALE(int): defaults to3(higher values follow the prompt more closely).WATERMARK(bool): default watermark preference when the task model omits the field.DEFAULT_SIZE(string): fallback size when not specified/invalid (defaults to2048x2048).REQUEST_TIMEOUT(int seconds): defaults to600.
The pipe validates and maps sizes to a known supported set:
- Exact sizes: 1024x1024, 2048x2048, 2304x1728, 1728x2304, 2560x1440, 1440x2560, 2496x1664, 1664x2496, 3024x1296, 4096x4096, 6240x2656
- Shorthands: 2K, 4K
- Open WebUI reports no task model configured:
- Set
TASK_MODEL_EXTERNAL(orTASK_MODEL) to a model ID present in Open WebUI’s model catalog and capable of Structured Outputs.
- Set
- Gateway rejects multiple images:
- The pipe retries with a single image automatically.
- Oversized input images:
- Images estimated over ~10 MB after decode are skipped.