Dil: TR
Ücretsiz başla

Ürün fotoğrafı stüdyosu, API olarak.

Herofab API bir ürün fotoğrafı ile bir araç adı alır ve işi arka planda işler; bitmiş görselin indirmeye hazır olduğunu sorgulama ya da imzalı bir webhook bildirir.

  • Bearer API anahtarları
  • İmzalı webhook'lar
  • Toplu işte en fazla 100 iş
  • OpenAPI 3.1 ve llms.txt

MCP https://app.herofab.app/mcpOpenAPI · GPT Actions https://app.herofab.app/api/agent/openapi.jsonMCP · API key https://app.herofab.app/mcp/studio

{
  "mcpServers": {
    "herofab-studio": {
      "type": "http",
      "url": "https://app.herofab.app/mcp/studio",
      "headers": {
        "Authorization": "Bearer hf_sk_live_..."
      }
    }
  }
}
curl https://app.herofab.app/api/v1/jobs -H "Authorization: Bearer $HEROFAB_API_KEY" -H "Idempotency-Key: $(uuidgen)" --json '{"tool": "ghost_mannequin", "inputs": {"garment": "ASSET_ID"}}'
Nasıl çalışır

Fotoğraftan bitmiş görsele.

01

Gönder

Ürün fotoğrafını yükleyin ve bir araç ile ayarlarını belirterek iş oluşturun; iş kredilerini ayırır.

POST /api/v1/assetsPOST /api/v1/jobs

02

Sorgula

İş bitene kadar durumunu okuyun ya da bittiğinde imzalı bir webhook alın.

GET /api/v1/jobs/{id}

03

İndir

Bitmiş görseli, işin çıktısının varlık kimliğiyle (asset ID) alın.

GET /api/v1/assets/{id}/content

Tam örnek: fotoğrafı yükleyin, işi oluşturun, bekleyin, indirin
API=https://app.herofab.app/api/v1
AUTH="Authorization: Bearer $HEROFAB_API_KEY"

# 1 · Upload the product photo
ASSET_ID=$(curl -s "$API/assets" \
  -H "$AUTH" \
  -F file=@shirt.jpg | jq -r .id)

# 2 · Create the job
BODY=$(jq -n --arg garment "$ASSET_ID" '{tool: "ghost_mannequin",
  inputs: {garment: $garment}, params: {style: "3d", backdrop: "white"}}')
JOB_ID=$(curl -s "$API/jobs" \
  -H "$AUTH" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d "$BODY" | jq -r .id)

# 3 · Poll until the job is finished
while :; do
  JOB=$(curl -s "$API/jobs/$JOB_ID" -H "$AUTH")
  STATE=$(jq -r .state <<<"$JOB")
  [ "$STATE" = queued ] || [ "$STATE" = running ] || break
  sleep 2
done
[ "$STATE" = succeeded ] || { jq -r .failure.code <<<"$JOB"; exit 1; }

# 4 · Download the image
OUTPUT_ID=$(jq -r '.outputs[0].asset_id' <<<"$JOB")
EXT=$(jq -r '.outputs[0].content_type | ltrimstr("image/")' <<<"$JOB")
curl -sL "$API/assets/$OUTPUT_ID/content" -H "$AUTH" -o "result.$EXT"
Başlayın

Yeni koleksiyonunuz, bu hafta çekilmiş olsun.

Kayıtta 20 kredi, kart gerekmez. Ücretsiz kredilerle üretilen görseller filigran taşır.