RepoReplicateReplicatepublished May 2, 2025seen 5d

replicate/goo-logo

Python

Open original ↗

Captured source

source ↗
published May 2, 2025seen 5dcaptured 17hhttp 200method plain

replicate/goo-logo

Description: Generates logos

Language: Python

Stars: 1

Forks: 0

Open issues: 0

Created: 2025-05-02T16:21:39Z

Pushed: 2025-12-10T04:03:56Z

Default branch: main

Fork: no

Archived: no

README:

Replicate goo logo generator

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.

See also: https://github.com/replicate/goo

What does it do?

  • 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.

Inputs

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"). |

Example usage

Generate a PNG image

cog predict -i format=png -i width=1024 -i height=1024 -i seed=42

Generate a JPEG image with a different goo pattern

cog predict -i format=jpeg -i scale=2 -i depth=5 -i seed=1234

Generate a 5-second MP4 video at 30 FPS

cog predict -i format=mp4 -i num_frames=150 -i fps=30 -i speed=5.0

The output will be written to a file, e.g. output.png or output.mp4.

Output

  • 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.

How it works

  • 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.

Requirements

  • Cog installed (see below).
  • Docker (Cog uses Docker to run the model).

Installation

Install Cog by following the official instructions:

brew install cog
# or
sh <(curl -fsSL https://cog.run/install.sh)

Running the model

After installing Cog and Docker, run predictions as shown above. You can also serve the model as an API:

cog serve -p 8080

Then POST to http://localhost:8080/predictions with your desired input options.

Customization

  • 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, and seed for different visual results.

Troubleshooting

  • 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.yaml should handle this).

License

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!

Notability

notability 0.0/10

Trivial repo with 1 star