/firefly-services:firefly-services-storage-refsfrom firefly-services
Asset storage and reference patterns for Adobe Firefly Services — Upload Endpoint, pre-signed URLs (S3/Azure/Dropbox), input source references for generative-fill / expand / similar / Photoshop / Lightroom, output destination references, pre-signed URL expiry, and the producer/consumer split for storage refs in queue-fronted workloads. Use whenever the user mentions "storage reference", "uploadId", "image ID", "pre-signed URL", "InvalidStorageReference", "how do I pass an image to Firefly", "S3 bucket", "Azure blob", or hits a 400312 error. Covers both the Firefly Upload Endpoint (returns an image ID) and the pre-signed-URL pattern (read from your own bucket).
Ships in firefly-services. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Pass images into Firefly endpoints and capture results out of them. Almost every generative or editing API requires an image to be referenced, not passed inline — and the rules differ by endpoint family. This skill is the canonical reference for the patterns.
Use this skill when:
InvalidStorageReference (error code 400312)Do NOT use this skill when:
firefly-custom-models for that workflowFirefly Services accepts image references in two formats. Pick one per workflow — do not mix.
The Firefly API has its own image-storage endpoint. You POST raw bytes, get back a short-lived image ID, and pass that ID to subsequent calls.
POST /v2/storage/image
↓ returns: {"images": [{"id": "abc-123..."}]}
Use: {"image": {"source": {"uploadId": "abc-123..."}}}
Note the nesting: every Firefly V3 image endpoint (Generate Similar, Expand, Fill) wraps the source in a top-level image object — {"image": {"source": {...}}}, with Fill's mask alongside it as image.mask. A bare top-level source fails request validation.
Use this pattern when:
Limitations:
You upload to your own bucket, generate a pre-signed URL that grants read access, and Firefly fetches from it.
Upload to S3/Azure/Dropbox (your storage)
↓
Generate pre-signed URL (your code)
↓
Pass to Firefly: {"image": {"source": {"url": "https://your-bucket.s3..."}}}
Use this pattern when:
Supported sources: Adobe documents pre-signed URL support for AWS S3 (amazonaws.com), Azure Blob (windows.net), and Dropbox (dropboxusercontent.com). In live testing, a Google Cloud Storage pre-signed URL (storage.googleapis.com) was rejected (422 "The file with given presigned url could not be reached") — treat GCS as unsupported for Firefly inputs as of this writing, and verify against current Adobe docs. For assets in GCS, copy to a supported store or use the Upload Endpoint (Pattern A).
curl --silent -X POST 'https://firefly-api.adobe.io/v2/storage/image' \
-H "Authorization: Bearer $FIREFLY_SERVICES_ACCESS_TOKEN" \
-H "X-API-Key: $FIREFLY_SERVICES_CLIENT_ID" \
-H "Content-Type: image/png" \
--data-binary "@./input.png"
Response:
{"images": [{"id": "abc-123-def-456-...."}]}
Node example (using axios):
import axios from 'axios';
import fs from 'node:fs';
async function uploadToFirefly({ filePath, mimeType, accessToken, clientId }) {
const stream = fs.createReadStream(filePath);
const stats = fs.statSync(filePath);
const res = await axios.post(
'https://firefly-api.adobe.io/v2/storage/image',
stream,
{
headers: {
Authorization: `Bearer ${accessToken}`,
'X-API-Key': clientId,
'Content-Type': mimeType,
'Content-Length': stats.size,
},
maxContentLength: Infinity,
maxBodyLength: Infinity,
},
);
return res.data.images[0].id;
}
curl --silent -X POST 'https://firefly-api.adobe.io/v3/images/generate-similar' \
-H "Authorization: Bearer $FIREFLY_SERVICES_ACCESS_TOKEN" \
-H "X-API-Key: $FIREFLY_SERVICES_CLIENT_ID" \
-H 'Content-Type: application/json' \
-d '{
"image": {"source": {"uploadId": "abc-123-def-456-..."}},
"numVariations": 3
}'
| Format | MIME |
|---|---|
| JPEG | image/jpeg |
| PNG | image/png |
| WebP | image/webp |
Max dimensions and file size vary by endpoint. Generate operations typically accept up to ~8MB. Larger assets need pre-processing (downscale, re-encode).
# AWS S3 — upload
aws s3 cp ./input.png s3://my-bucket/sources/input.png \
--acl private \
--content-type image/png
# Azure Blob
az storage blob upload \
--account-name myaccount \
--container-name sources \
--name input.png \
--file ./input.png
The URL must grant GET access to Firefly's backend. Expiry should be just long enough to cover the job duration (1-3 hours is typical; for V3 async jobs, 2 hours minimum).
# AWS S3 — sign for 2 hours
aws s3 presign s3://my-bucket/sources/input.png --expires-in 7200
# Azure Blob — SAS token, 2 hours
az storage blob generate-sas \
--account-name myaccount \
--container-name sources \
--name input.png \
--permissions r \
--expiry $(date -u -d '+2 hours' +'%Y-%m-%dT%H:%MZ') \
--https-only \
--full-uri
Node S3 example:
import { S3Client, GetObjectCommand } from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
const s3 = new S3Client({ region: 'us-east-1' });
async function signedSourceUrl(bucket, key) {
return getSignedUrl(
s3,
new GetObjectCommand({ Bucket: bucket, Key: key }),
{ expiresIn: 7200 },
);
}
curl --silent -X POST 'https://firefly-api.adobe.io/v3/images/generate-similar' \
-H "Authorization: Bearer $FIREFLY_SERVICES_ACCESS_TOKEN" \
-H "X-API-Key: $FIREFLY_SERVICES_CLIENT_ID" \
-H 'Content-Type: application/json' \
-d '{
"image": {"source": {"url": "https://my-bucket.s3.amazonaws.com/sources/input.png?X-Amz-..."}},
"numVariations": 3
}'
Photoshop API and Lightroom API write outputs back to a pre-signed URL you provide. The pattern:
outputs[].href with the matching outputs[].storage value in the requestExample for Photoshop smart-object replacement. Generate the PUT URL with the SDK — the aws s3 presign CLI command produces GET-only URLs (it has no method option):
import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
const s3 = new S3Client({ region: 'us-east-1' });
// Pre-signed PUT URL, valid 2 hours
const outputUrl = await getSignedUrl(
s3,
new PutObjectCommand({ Bucket: 'my-bucket', Key: 'outputs/result.psd' }),
{ expiresIn: 7200 },
);
# OUTPUT_URL = the pre-signed PUT URL generated by the SDK snippet above
curl --silent -X POST 'https://image.adobe.io/pie/psdService/smartObject' \
-H "Authorization: Bearer $FIREFLY_SERVICES_ACCESS_TOKEN" \
-H "X-API-Key: $FIREFLY_SERVICES_CLIENT_ID" \
-H 'Content-Type: application/json' \
-d "{
\"inputs\": [{\"href\": \"$SOURCE_URL\", \"storage\": \"external\"}],
\"options\": {\"layers\": [...]},
\"outputs\": [{\"href\": \"$OUTPUT_URL\", \"storage\": \"external\", \"type\": \"vnd.adobe.photoshop\"}]
}"
The storage field distinguishes the location type. The Photoshop and Lightroom API specs accept exactly three values:
| Value | Meaning |
|---|---|
external | Pre-signed URL on your bucket — S3 pre-signed URLs use this value |
azure | Azure Blob (SAS URL) |
dropbox | Dropbox |
Pre-signed URLs expire. For long-running async jobs this is a real failure mode.
Rule: Generate the URL just before the Firefly call, not at job-creation time.
Wrong (causes intermittent 400312 errors):
// User submits job
const sourceUrl = await signUrl(bucket, key, 3600); // signed for 1 hour
await db.put({ jobId, sourceUrl, status: 'pending' });
// Worker picks up the job 50 minutes later
const job = await db.get(jobId);
await firefly.generate({ image: { source: { url: job.sourceUrl } } }); // URL has 10 min left — flaky
Right:
// User submits job — store the *key*, not a signed URL
await db.put({ jobId, sourceBucket: bucket, sourceKey: key, status: 'pending' });
// Worker re-signs just before the call
const job = await db.get(jobId);
const sourceUrl = await signUrl(job.sourceBucket, job.sourceKey, 7200);
await firefly.generate({ image: { source: { url: sourceUrl } } });
This pattern eliminates an entire class of intermittent failure that almost always surfaces when scaling a generative pipeline from UAT to production.
For the pre-signed URL pattern, the bucket must allow GET (and PUT for outputs) from Adobe's backend. Adobe does not publish a stable IP range for these fetches (as of this writing), so IP allowlisting is not a reliable mechanism here — rely on the pre-signed URL itself as the authentication mechanism.
| Setting | Value |
|---|---|
| Bucket policy | Default — no public access |
| CORS | Not required (Firefly is server-to-server) |
| Encryption | SSE-S3 / SSE-KMS — works fine with pre-signed URLs |
| Versioning | Recommended for source asset auditability |
| Lifecycle | Move sources to Glacier after 30 days; keep outputs hot |
Some endpoints accept multiple image inputs (e.g., style reference + content reference). The shape is consistent:
{
"prompt": "a cat in the style of the reference",
"style": {"imageReference": {"source": {"url": "https://..."}}},
"structure": {"imageReference": {"source": {"url": "https://..."}}}
}
Each reference is independent — you can mix Pattern A (Upload Endpoint) and Pattern B (pre-signed URL) within the same request:
{
"style": {"imageReference": {"source": {"uploadId": "abc-123"}}},
"structure": {"imageReference": {"source": {"url": "https://..."}}}
}
Storage references are correctly wired when:
<2s for typical 4MB imagesInvalidStorageReference errors do not occur in productionInvalidStorageReference (400312): Either the input uploadId is stale (input upload IDs are valid 7 days) or the pre-signed URL is expired / returns non-200 / returns wrong content-type. Re-sign just before the call. (Note: this 7-day input TTL is separate from output pre-signed result URLs, which expire ~1 hour.)Content-Type is missing or wrong. Must match the actual format (image/jpeg, image/png, image/webp).curl -s -o /dev/null -w '%{http_code}' -r 0-0 '<url>' — rather than curl -I: a HEAD request against a GET-signed S3 URL returns 403 because the signature covers the HTTP method, producing false alarms on valid URLs. A 200 from an external network is strong evidence Adobe's backend can fetch it too. A 403 on the range-limited GET means the signing failed; regenerate.aws s3 presign generates GET-only URLs — generate PUT URLs via the SDK (getSignedUrl with PutObjectCommand). GET URLs cannot be used as PUT destinations.az storage blob generate-sas) — not S3-style query parameters.amazonaws.com, Azure windows.net, and Dropbox dropboxusercontent.com are), and a GCS pre-signed URL was rejected in live testing (422 "could not be reached"). Copy the asset to a supported store or use the Upload Endpoint. Note the asymmetry: the Photoshop and Lightroom APIs accept GCS pre-signed URLs via storage: "external" — any reachable signed HTTPS URL works there (validated against the live API). This restriction applies only to the Firefly image-reference family.firefly-services-bootstrap — Has to run before any storage workfirefly-generate-image-v3-async — Most common storage-ref consumerfirefly-generate-similar — Pure source-reference workflowfirefly-expand-fill — Source + mask reference workflowphotoshop-api-actions — Input + output destination patternWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub focus-gts/firefly-services-skills --plugin firefly-services19 skills in this plugin
/firefly-batch-pipelineThe end-to-end production reference architecture for high-volume generative campaign workloads on Adobe Firefly Services — SQS-fronted intake, Lambda worker pool with per-credential token-bucket pacing, Step Functions orchestration for multi-stage PSD composition, DynamoDB job state, S3 result persistence, DLQ replay, and webhook-driven customer notification. Use whenever the user mentions "batch pipeline", "campaign at scale", "thousands of images per day", "generative pipeline", "campaign assembler", "asset factory", "production-grade pipeline", or designs a system that combines Firefly generation with Photoshop composition at volume. Stitches `firefly-services-rate-limits` and `photoshop-api-composition` into a single deployable blueprint./firefly-brand-guardrailsEnforce brand compliance on generative output — custom-model lock-in, prompt and output content filtering, asset tagging for downstream policy, and the human-review queue pattern for regulated or brand-sensitive workloads. Use whenever the user mentions "brand compliance", "brand safety", "regulated industry", "review queue", "approval workflow", "content moderation", "brand guardrails", "legal review", "compliance hold", or generates assets for financial services, pharma, automotive, public sector, or any customer with a brand-review process. Encodes the production guardrail pattern that turns "Firefly generates whatever it wants" into "every asset that ships passes a documented compliance gate."/firefly-cost-optimizationThe production playbook for understanding and controlling Adobe Firefly Services consumption — where API spend actually goes, what to cache, what to batch, seed reuse for deterministic regenerations, prompt deduplication, response caching, custom-model-vs-style-reference cost tradeoff, and the "why is consumption 3× higher than expected" debugging sequence. Use whenever the user mentions "cost", "consumption", "API spend", "budget", "billing surprise", "consumption is high", "credits burning fast", "FinOps", "cost overrun", or wants to understand the cost shape of a generative pipeline before deploying it. Encodes the FinOps pattern that keeps generative pipelines on budget at scale./firefly-custom-modelsTrain, manage, and invoke Adobe Firefly Custom Models — subject vs style models, training data preparation (10-30 reference images), training submission and polling, asset ID management, generation with `customModelId` and `x-model-version: image3_custom`, retraining cadence, and brand-aligned generation at scale. Use whenever the user mentions "custom model", "brand model", "train a model", "fine-tune Firefly", "subject model", "style model", "Custom Models API", `customModelId`, or describes iconography / brand-asset / character generation that requires consistency. Encodes the production pattern for brand iconography workflows where custom-model output dramatically reduces design cycle time./firefly-expand-fillUse Adobe Firefly's Generative Expand and Generative Fill APIs — when to use each, masking strategies, placement and aspect ratio control, prompt patterns for clean extension and inpainting, and the difference between filling versus replacing image regions. Use whenever the user mentions "generative expand", "extend canvas", "generative fill", "inpaint", "outpaint", "remove object", "replace background", "expand image", "fill image", "masking", "expand-async", "fill-async", or wants to grow / patch / modify an existing image. Encodes production patterns for background extension on hero assets and for brand-aligned background replacement in high-volume template-driven campaign asset production./firefly-generate-image-v3-asyncGenerate images with the Adobe Firefly V3 asynchronous API — job submission, status polling, webhook callbacks, prompt structure, content class, style and structure references, seed control, multi-variation results, and the migration from V2 sync to V3 async. Use whenever the user wants to "generate an image with Firefly", "text-to-image", "Firefly V3", "async generate", "polling", "jobId", "statusUrl", or upgrades from V2 sync. Returns the production pattern for the highest-volume Firefly workload — including a polling cadence that avoided rate limiting in live testing and a webhook design pattern for scaling to thousands of concurrent jobs.