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 🙏

© 2025 – Pkg Stats / Ryan Hefner

adobe-firefly-ai-sdk

v1.0.0

Published

AI SDK provider for Adobe Firefly image generation models

Downloads

98

Readme

adobe-firefly-ai-sdk-provider

Adobe Firefly provider for Vercel AI SDK v5, enabling text-to-image generation using Adobe's Firefly API.

Installation

pnpm add adobe-firefly-ai-sdk

CLI Test

bun examples/simple-firefly.ts

Setup

  1. Sign up for Adobe Firefly API access and obtain your Client ID and Client Secret
  2. Set the environment variables:
ADOBE_FIREFLY_CLIENT_ID=your_client_id_here
ADOBE_FIREFLY_CLIENT_SECRET=your_client_secret_here

Usage

Basic Usage

import { firefly } from 'adobe-firefly-ai-sdk';
import { experimental_generateImage as generateImage } from 'ai';

const { images } = await generateImage({
  model: firefly.image('firefly-v3'),
  prompt: 'A beautiful sunset over mountains with vibrant colors',
  n: 2,
  size: '1024x1024',
});

// images is an array of { uint8Array: Uint8Array, mimeType: string }

Custom Configuration

import { createAdobeFirefly } from 'adobe-firefly-ai-sdk';

const customFirefly = createAdobeFirefly({
  clientId: process.env.CUSTOM_ADOBE_CLIENT_ID!,
  clientSecret: process.env.CUSTOM_ADOBE_CLIENT_SECRET!,
});

const model = customFirefly.image('firefly-v3');

Advanced Options

Adobe Firefly supports additional options through the model configuration:

import { experimental_generateImage as generateImage } from 'ai';
import { firefly } from 'adobe-firefly-ai-sdk';

const { images } = await generateImage({
  model: firefly.image('firefly-v3'),
  prompt: 'A professional academic diagram of a paramecium cell',
  n: 4, // Up to 4 images per request
  size: '1024x1024', // Supports various sizes up to 2688x2688
  seed: 12345, // For reproducible results
});

Supported Models

  • firefly-v3 (default) - Latest Adobe Firefly model

Supported Sizes

Adobe Firefly supports custom dimensions from 1x1 up to 2688x2688 pixels. Common sizes include:

  • 512x512
  • 1024x1024
  • 1536x1536
  • 2048x2048
  • Custom sizes like 1920x1080, 1080x1920, etc.

API Features

Image Generation Limits

  • Maximum 4 images per request (n parameter)
  • Image dimensions: 1x1 to 2688x2688 pixels
  • Supports PNG format output

Adobe Firefly Specific Features

The Adobe Firefly API supports additional advanced features that can be accessed through the underlying types:

import type { ImageGenPayload } from 'adobe-firefly-ai-sdk';

// These features are available in the API but not exposed through
// the Vercel AI SDK interface:
// - contentClass: 'photo' | 'art'
// - visualIntensity: 2-10
// - style presets and references
// - structure references
// - negative prompts
// - tileable images

Error Handling

The provider includes comprehensive error handling for common scenarios:

try {
  const { images } = await generateImage({
    model: firefly.image('firefly-v3'),
    prompt: 'Your prompt here',
  });
} catch (error) {
  console.error('Image generation failed:', error.message);
  // Handle authentication, rate limiting, or API errors
}

Environment Variables

| Variable | Description | Required | |----------|-------------|----------| | ADOBE_FIREFLY_CLIENT_ID | Your Adobe Firefly Client ID | Yes | | ADOBE_FIREFLY_CLIENT_SECRET | Your Adobe Firefly Client Secret | Yes |

TypeScript Support

This package includes full TypeScript definitions and supports all Adobe Firefly API types:

import type {
  AdobeFireflyConfig,
  ImageGenPayload,
  GenerateImageResponse
} from 'adobe-firefly-ai-sdk';

License

MIT