npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@teamflojo/floimg-google

v0.7.0

Published

Google Imagen image generation plugin for floimg

Downloads

695

Readme

@teamflojo/floimg-google

Google AI integration for floimg, providing Gemini image generation, editing, and AI capabilities.

Standing on the Shoulders of Giants

This plugin integrates with Google's Gemini multimodal AI. We provide a consistent FloImg interface while exposing the full power of Google's models.

  • Full Gemini power: Native image generation and editing with all Gemini parameters
  • Native format: Use Gemini parameters, not a FloImg abstraction
  • Their docs are your docs: See Google AI documentation

FloImg orchestrates the workflow (generate -> transform -> save). Gemini does what it does best.

Installation

npm install @teamflojo/floimg-google
# or
pnpm add @teamflojo/floimg-google

Configuration

Set your Google AI API key:

export GOOGLE_AI_API_KEY=your_key_here

Or pass it directly:

import { geminiGenerate } from "@teamflojo/floimg-google";

const generator = geminiGenerate({ apiKey: "your_key_here" });

Features

Image Generation (Gemini)

Generate images using Gemini's native image generation:

import { createClient } from "@teamflojo/floimg";
import { geminiGenerate } from "@teamflojo/floimg-google";

const floimg = createClient();
floimg.registerGenerator(geminiGenerate());

const image = await floimg.generate({
  generator: "gemini-generate",
  params: {
    prompt: "A serene mountain landscape at sunset",
    aspectRatio: "16:9",
    imageSize: "2K",
  },
});

Parameters:

| Parameter | Type | Default | Description | | ------------------- | -------------------- | ------------------------ | ------------------------------------------------- | | prompt | string | (required) | Image description | | prePrompt | string | "Generate an image..." | Instructions prepended to prompt | | model | string | "gemini-2.5-flash-image" | Gemini model to use | | aspectRatio | string | "1:1" | Output aspect ratio (1:1, 16:9, 9:16, etc.) | | imageSize | "1K" | "2K" | "4K" | "1K" | Output resolution | | groundingWithSearch | boolean | false | Enable Google Search grounding for real-time data | | enhancePrompt | boolean | false | Auto-enhance prompt using best practices | | referenceImages | ImageBlob[] | undefined | Up to 14 reference images for style/consistency |

Image Editing (Gemini Transform)

Edit existing images using Gemini's multimodal capabilities:

import { geminiTransform } from "@teamflojo/floimg-google";

floimg.registerTransformProvider(geminiTransform());

const edited = await floimg.transform({
  blob: inputImage,
  op: "edit",
  provider: "gemini-transform",
  params: {
    prompt: "Make the sky more vibrant and add clouds",
    enhancePrompt: true,
  },
});

Transform Parameters:

| Parameter | Type | Default | Description | | --------------- | ------- | --------- | ---------------------------------------- | | prompt | string | (req.) | Describe the edits to make | | prePrompt | string | "Edit..." | Instructions prepended to prompt | | enhancePrompt | boolean | false | Auto-enhance prompt using best practices | | referenceImages | array | [] | Up to 13 additional reference images |

Prompt Enhancement

The enhancePrompt option automatically expands your prompts based on Google's image generation best practices. It detects the type of image you're creating and applies appropriate enhancements.

// Without enhancement
const image = await floimg.generate({
  generator: "gemini-generate",
  params: {
    prompt: "photo of a mountain",
  },
});
// Prompt sent: "photo of a mountain"

// With enhancement
const image = await floimg.generate({
  generator: "gemini-generate",
  params: {
    prompt: "photo of a mountain",
    enhancePrompt: true,
  },
});
// Prompt sent: "A photorealistic photo of a mountain. The scene is
// illuminated by soft natural light. Captured with professional
// photography equipment, sharp focus, high detail"

Detected Prompt Types:

| Type | Keywords | Enhancement Style | | -------------- | --------------------------------- | ----------------------------------- | | photorealistic | photo, realistic, camera, lens | Adds lighting, camera details | | portrait | portrait, headshot, face, person | Photography terms, focus details | | landscape | landscape, mountain, ocean, sky | Lighting, atmosphere | | illustration | illustration, cartoon, anime, art | Style, color palette | | logo | logo, brand, icon, emblem | Modern, professional, scalable | | product | product, e-commerce, mockup | Studio lighting, neutral background | | minimalist | minimalist, simple, clean | Negative space, subtle lighting | | edit | change, modify, remove, add | Preservation instructions |

Using Enhancement Utilities Directly:

import { enhancePrompt, detectPromptType, isPromptDetailed } from "@teamflojo/floimg-google";

// Detect prompt type
const type = detectPromptType("photo of a sunset"); // "photorealistic"

// Check if prompt needs enhancement
const needsEnhancement = !isPromptDetailed("cat"); // true

// Enhance a prompt manually
const enhanced = enhancePrompt("photo of a mountain", "generate");

Vision Analysis (Gemini Vision)

Analyze images using Gemini's multimodal understanding:

import { geminiVision } from "@teamflojo/floimg-google";

floimg.registerVisionProvider(geminiVision());

const analysis = await floimg.analyze({
  blob: inputImage,
  provider: "gemini-vision",
  params: {
    prompt: "Describe this image in detail",
  },
});

Text Generation (Gemini Text)

Generate text for image workflows:

import { geminiText } from "@teamflojo/floimg-google";

floimg.registerTextProvider(geminiText());

const result = await floimg.text({
  provider: "gemini-text",
  params: {
    prompt: "Write a caption for this sunset photo",
    context: analysis.content,
  },
});

Available Models

| Model | Description | | -------------------------- | ------------------------------------------- | | gemini-2.5-flash-image | Fast, high-volume, low-latency (default) | | gemini-3-pro-image-preview | Professional quality, better text rendering |

License

MIT