This Cog model generates vibrant, animated or still "goo" backgrounds and overlays a logo in the center. It can output a single image (PNG, JPEG, TIFF) or a looping MP4 video, with a variety of customization options for the goo effect.
output.mp4
See also: https://github.com/replicate/goo
- Generates a colorful, animated "goo" effect using a ModernGL shader.
- Overlays a logo (provided in the model) at the center of the output.
- Outputs either a static image or a video, depending on your choice.
You can control the output with the following options:
| Name | Type | Default | Description |
|---|---|---|---|
seed |
int | -1 | Seed for the random number generator. Use -1 for a random seed. |
width |
int | 512 | Width of the output image/video (1–4096). |
height |
int | 512 | Height of the output image/video (1–4096). |
scale |
int | 1 | Scale factor for the goo effect. Higher values zoom in/out on the goo pattern. |
depth |
int | 3 | Number of iterations for the goo effect. Higher values create more complex patterns. |
format |
str | "png" | Output format: "png", "jpeg", "tiff", or "mp4" (for video). |
speed |
float | 2.0 | Speed of the goo animation (0.0–10.0). Higher is faster. |
num_frames |
int | 600 | Number of frames for video output (only used when format is "mp4"). |
fps |
int | 60 | Frames per second for video output (only used when format is "mp4"). |
cog predict -i format=png -i width=1024 -i height=1024 -i seed=42cog predict -i format=jpeg -i scale=2 -i depth=5 -i seed=1234cog predict -i format=mp4 -i num_frames=150 -i fps=30 -i speed=5.0The output will be written to a file, e.g. output.png or output.mp4.
- Image formats: PNG, JPEG, TIFF
- Video format: MP4 (H.264, browser-compatible)
All outputs have the goo effect as the background, with the logo centered and sized to 50% of the smallest image dimension.
- Uses a ModernGL shader to generate the goo effect.
- Overlays a logo (decoded from base64) using Pillow.
- For videos, frames are streamed to FFmpeg for efficient MP4 encoding.
- Cog installed (see below).
- Docker (Cog uses Docker to run the model).
Install Cog by following the official instructions:
brew install cog
# or
sh <(curl -fsSL https://cog.run/install.sh)After installing Cog and Docker, run predictions as shown above. You can also serve the model as an API:
cog serve -p 8080Then POST to http://localhost:8080/predictions with your desired input options.
- Logo: The logo is embedded in the model as a base64 PNG. To use a different logo, you’ll need to modify the model code.
- Goo effect: Tweak
scale,depth,speed, andseedfor different visual results.
- If you get errors about OpenGL or EGL, ensure your Docker environment supports headless OpenGL rendering.
- For video output, FFmpeg must be available in the container (the provided
cog.yamlshould handle this).
MIT (or specify your license here).
Questions?
Join the Replicate Discord or open an issue!
Let me know if you want to include example images, API schema, or further details!