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

profile-picture-generator-ai

v1.0.0

Published

AI-powered profile picture generator using Google Gemini. Generate professional, anime, cartoon, and artistic avatars in seconds.

Readme

Profile Picture Generator

An AI-powered profile picture generator for Node.js. Generate professional headshots, anime avatars, cartoon portraits, and more — right from your terminal or JavaScript code. Powered by PFPMaker.

Features

  • Generate AI profile pictures from a text description
  • 10 built-in art styles: professional, anime, cartoon, artistic, minimal, realistic, fantasy, cyberpunk, watercolor, pixel
  • Save output as PNG directly to disk
  • Simple CLI — works with npx, no install required
  • Clean JavaScript API for use in your projects
  • Zero production dependencies
  • Node.js 14+

Quick Start

npx profile-picture-generator --prompt "smiling developer with glasses" --style professional --output avatar.png

You'll need a free Gemini API key to use this tool.


Installation

# Run without installing (recommended)
npx profile-picture-generator --help

# Install globally
npm install -g profile-picture-generator

# Install locally in your project
npm install profile-picture-generator

CLI Usage

generate-pfp [options]

Options

| Flag | Description | Default | |------|-------------|---------| | --prompt <text> | Description of your profile picture | "professional profile picture" | | --style <name> | Art style to apply | professional | | --output <file> | Output file path | profile-picture.png | | --apiKey <key> | Your Gemini API key | GEMINI_API_KEY env var | | --styles | List all available styles | — | | --help | Show help | — |

CLI Examples

# Professional headshot
generate-pfp --prompt "confident software engineer" --style professional --output headshot.png

# Anime avatar
generate-pfp --prompt "young woman with short hair" --style anime --output anime-avatar.png

# Fantasy character
generate-pfp --prompt "wise old wizard with a long beard" --style fantasy --output wizard.png

# Set API key via environment variable (recommended)
export GEMINI_API_KEY=your_key_here
generate-pfp --prompt "friendly cartoon fox" --style cartoon

API Usage

const ProfilePictureGenerator = require('profile-picture-generator');

const generator = new ProfilePictureGenerator({
  apiKey: process.env.GEMINI_API_KEY, // or pass your key directly
});

// Generate and save to file
const image = await generator.generate({
  prompt: 'smiling woman with red hair',
  style: 'professional',
  output: 'avatar.png', // optional: saves automatically
});

// Or save manually
await generator.saveToFile(image, 'avatar.png');

// Or get a data URI for use in HTML/CSS
const dataURI = generator.toDataURI(image);
console.log(dataURI); // data:image/png;base64,...

Constructor Options

| Option | Description | Default | |--------|-------------|---------| | apiKey | Required. Your Google Gemini API key | — | | model | Gemini model to use | gemini-2.0-flash-preview-image-generation |

generate(options) Options

| Option | Description | Default | |--------|-------------|---------| | prompt | Text description of the image | "profile picture of a person" | | style | Style key (see table below) | professional | | output | File path to save the PNG | null (no auto-save) |

Return Value

generate() returns a Promise resolving to:

{
  data: string,      // Base64-encoded image data
  mimeType: string,  // e.g. "image/png"
}

Available Styles

| Style | Description | |-------|-------------| | professional | Corporate headshot, neutral background, formal attire | | anime | Anime-style with vibrant colors and expressive eyes | | cartoon | Bold outlines, fun colors, friendly expression | | artistic | Painterly brushstroke portrait, gallery quality | | minimal | Flat illustration, geometric, limited palette | | realistic | Photorealistic, soft natural lighting | | fantasy | Epic fantasy character, ornate details, dramatic lighting | | cyberpunk | Neon accents, futuristic aesthetic, dark background | | watercolor | Soft watercolor painting, pastel tones | | pixel | 16-bit pixel art, retro game style |

List all styles from the CLI:

generate-pfp --styles

Full API Example

const ProfilePictureGenerator = require('profile-picture-generator');

async function main() {
  const generator = new ProfilePictureGenerator({
    apiKey: process.env.GEMINI_API_KEY,
  });

  // List available styles
  console.log('Styles:', ProfilePictureGenerator.styles);

  // Generate multiple avatars
  const styles = ['professional', 'anime', 'cyberpunk'];

  for (const style of styles) {
    console.log(`Generating ${style} avatar...`);
    await generator.generate({
      prompt: 'young developer with a friendly smile',
      style,
      output: `avatar-${style}.png`,
    });
  }

  console.log('Done!');
}

main().catch(console.error);

Getting a Gemini API Key

  1. Go to Google AI Studio
  2. Sign in with your Google account
  3. Click Get API KeyCreate API key
  4. Copy the key and use it via --apiKey or the GEMINI_API_KEY environment variable

The free tier is generous and sufficient for personal use.


License

MIT


About

Want a no-code, web-based profile picture generator? Check out PFPMaker — an AI profile picture tool that requires no setup.