imagegen

package
v0.0.0-...-b876957 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadURL

func DownloadURL(url string) ([]byte, error)

DownloadURL downloads a URL and returns the raw bytes only if the content is an image (image/png, image/jpeg, image/webp). Non-image URLs are skipped.

func Edit

func Edit(apiKey, prompt string, refImages [][]byte) ([]byte, error)

Edit modifies image(s) based on a text prompt using OpenAI's gpt-image-1 model. refImages contains raw image bytes (PNG/JPEG) to use as references. Returns raw PNG bytes.

func ExtractURLs

func ExtractURLs(text string) (string, []string)

ExtractURLs extracts HTTP/HTTPS URLs from text and returns the cleaned text (without URLs) and the list of extracted URLs.

func Generate

func Generate(apiKey, prompt string) ([]byte, error)

Generate creates an image from a text prompt using OpenAI's gpt-image-1 model. Returns raw PNG bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL