Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/docs/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3132,6 +3132,22 @@ export function QdrantIcon(props: SVGProps<SVGSVGElement>) {
)
}

export function QuiverIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg {...props} viewBox='0 0 250 250' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path d='m249.3 0.88h-248.5v248.2h248.5v-248.2z' fill='#F6F6F7' />
<path
d='m124.3 25h-5.93l-1.95 0.59-7.9 0.29-1.47 0.88-7.9 1.18-1.18 0.88-9.09 2.85-0.88 0.88-11.86 5.93-0.88 1.18-6.23 2.55-8.29 8.3-7.61 4.75-5.34 8.6-5.04 4.75-4.46 8.6-2.05 1.18-3.26 8.6-0.88 0.59-3.85 12.16-0.59 0.59-2.35 13.04v1.47l-0.59 7.12 0.3 1.18-0.3 3.15 1.18 13.04 0.59 0.88 0.88 7.51 0.88 1.18 3.85 12.16 0.88 0.6 4.44 9.97 1.18 0.88 4.15 8 12.73 16.17 4.45 2.06 8.8 8.3 0.88 0.29 4.16 3.15h1.18l8.2 4.75h0.88l7.9 3.44h0.88l9.38 2.85 0.88 0.3 13.33 1.46h107.9v-101.3l-0.88-2.06v-8.3l-0.59-0.88v-4.16l-4.75-14.23v-4.16l-11.26-19.46-1.48-1.48-10.37-13.05-5.63-3.15-7.61-7.31-3.15-1.18-5.93-4.75-1.48-0.29-7.01-4.15h-1.18l-8.2-3.15h-0.88l-10.37-3.14h-1.18l-8.49-1.18-2.06-0.88h-7.5z'
fill='#333'
/>
<path
d='m78.38 72.26 118.6 41.21c4.65 1.69 3.47 8.5-1.47 8.5h-74v74.32c0 5.04-7.11 5.92-8.78 1.17l-40.58-118.5c-1.28-3.95 2.27-8.11 6.19-6.72z'
fill='#F9F9F9'
/>
</svg>
)
}

export function AshbyIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg {...props} viewBox='0 0 254 260' fill='none' xmlns='http://www.w3.org/2000/svg'>
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/components/ui/icon-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ import {
PosthogIcon,
PulseIcon,
QdrantIcon,
QuiverIcon,
RDSIcon,
RedditIcon,
RedisIcon,
Expand Down Expand Up @@ -298,6 +299,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
posthog: PosthogIcon,
pulse_v2: PulseIcon,
qdrant: QdrantIcon,
quiver: QuiverIcon,
rds: RDSIcon,
reddit: RedditIcon,
redis: RedisIcon,
Expand Down
1 change: 1 addition & 0 deletions apps/docs/content/docs/en/tools/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"posthog",
"pulse",
"qdrant",
"quiver",
"rds",
"reddit",
"redis",
Expand Down
131 changes: 131 additions & 0 deletions apps/docs/content/docs/en/tools/quiver.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
title: Quiver
description: Generate and vectorize SVGs
---

import { BlockInfoCard } from "@/components/ui/block-info-card"

<BlockInfoCard
type="quiver"
color="#000000"
/>

{/* MANUAL-CONTENT-START:intro */}
[QuiverAI](https://quiver.ai/) is an AI-powered SVG generation platform that creates high-quality, scalable vector graphics from text descriptions or by vectorizing raster images. It produces clean, resolution-independent SVGs that are ideal for icons, illustrations, logos, and UI elements.

With Quiver, you can:

- **Generate SVGs from text prompts**: Describe the vector graphic you need and get production-ready SVG output
- **Vectorize raster images**: Convert PNG, JPG, and other raster images into clean SVG vector format
- **Provide reference images**: Upload up to 4 reference images to guide the style and composition of generated SVGs
- **Control generation parameters**: Adjust temperature, number of outputs, and token limits to fine-tune results
- **List available models**: Query available QuiverAI models to discover supported operations and capabilities
- **Get clean SVG markup**: Receive raw SVG content alongside downloadable files for easy embedding

In Sim, the Quiver integration enables your workflows to generate and vectorize graphics on demand. This is useful for creating dynamic illustrations, converting raster assets to scalable vectors, generating icons for applications, producing visual assets for content pipelines, or building design automation workflows. The generated SVGs are returned as files that can be passed to downstream blocks for further processing, storage, or delivery.
{/* MANUAL-CONTENT-END */}


## Usage Instructions

Generate SVG images from text prompts or vectorize raster images into SVGs using QuiverAI. Supports reference images, style instructions, and multiple output generation.



## Tools

### `quiver_text_to_svg`

Generate SVG images from text prompts using QuiverAI

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `apiKey` | string | Yes | QuiverAI API key |
| `prompt` | string | Yes | A text description of the desired SVG |
| `model` | string | Yes | The model to use for SVG generation \(e.g., "arrow-preview"\) |
| `instructions` | string | No | Style or formatting guidance for the SVG output |
| `references` | file | No | Reference images to guide SVG generation \(up to 4\) |
| `n` | number | No | Number of SVGs to generate \(1-16, default 1\) |
| `temperature` | number | No | Sampling temperature \(0-2, default 1\) |
| `top_p` | number | No | Nucleus sampling probability \(0-1, default 1\) |
| `max_output_tokens` | number | No | Maximum output tokens \(1-131072\) |
| `presence_penalty` | number | No | Token penalty for prior output \(-2 to 2, default 0\) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the SVG generation succeeded |
| `output` | object | Generated SVG output |
| ↳ `file` | file | Generated SVG file |
| ↳ `svgContent` | string | Raw SVG markup content |
| ↳ `id` | string | Generation request ID |
| ↳ `usage` | json | Token usage statistics |
| ↳ `totalTokens` | number | Total tokens used |
| ↳ `inputTokens` | number | Input tokens used |
| ↳ `outputTokens` | number | Output tokens used |

### `quiver_image_to_svg`

Convert raster images into vector SVG format using QuiverAI

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `apiKey` | string | Yes | QuiverAI API key |
| `model` | string | Yes | The model to use for vectorization \(e.g., "arrow-preview"\) |
| `image` | file | Yes | The raster image to vectorize into SVG |
| `temperature` | number | No | Sampling temperature \(0-2, default 1\) |
| `top_p` | number | No | Nucleus sampling probability \(0-1, default 1\) |
| `max_output_tokens` | number | No | Maximum output tokens \(1-131072\) |
| `presence_penalty` | number | No | Token penalty for prior output \(-2 to 2, default 0\) |
| `auto_crop` | boolean | No | Automatically crop the image before vectorizing |
| `target_size` | number | No | Square resize target in pixels \(128-4096\) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the vectorization succeeded |
| `output` | object | Vectorized SVG output |
| ↳ `file` | file | Generated SVG file |
| ↳ `svgContent` | string | Raw SVG markup content |
| ↳ `id` | string | Vectorization request ID |
| ↳ `usage` | json | Token usage statistics |
| ↳ `totalTokens` | number | Total tokens used |
| ↳ `inputTokens` | number | Input tokens used |
| ↳ `outputTokens` | number | Output tokens used |

### `quiver_list_models`

List all available QuiverAI models

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `apiKey` | string | Yes | QuiverAI API key |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the request succeeded |
| `output` | object | Available models |
| ↳ `models` | json | List of available QuiverAI models |
| ↳ `id` | string | Model identifier |
| ↳ `name` | string | Human-readable model name |
| ↳ `description` | string | Model capabilities summary |
| ↳ `created` | number | Unix timestamp of creation |
| ↳ `ownedBy` | string | Organization that owns the model |
| ↳ `inputModalities` | json | Supported input types \(text, image, svg\) |
| ↳ `outputModalities` | json | Supported output types \(text, image, svg\) |
| ↳ `contextLength` | number | Maximum context window |
| ↳ `maxOutputLength` | number | Maximum generation length |
| ↳ `supportedOperations` | json | Available operations \(svg_generate, svg_edit, svg_animate, svg_vectorize, chat_completions\) |
| ↳ `supportedSamplingParameters` | json | Supported sampling parameters \(temperature, top_p, top_k, repetition_penalty, presence_penalty, stop\) |


2 changes: 2 additions & 0 deletions apps/sim/app/(landing)/integrations/data/icon-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ import {
PosthogIcon,
PulseIcon,
QdrantIcon,
QuiverIcon,
RDSIcon,
RedditIcon,
RedisIcon,
Expand Down Expand Up @@ -298,6 +299,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
posthog: PosthogIcon,
pulse_v2: PulseIcon,
qdrant: QdrantIcon,
quiver: QuiverIcon,
rds: RDSIcon,
reddit: RedditIcon,
redis: RedisIcon,
Expand Down
31 changes: 31 additions & 0 deletions apps/sim/app/(landing)/integrations/data/integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -8518,6 +8518,37 @@
"integrationType": "databases",
"tags": ["vector-search", "knowledge-base"]
},
{
"type": "quiver",
"slug": "quiver",
"name": "Quiver",
"description": "Generate and vectorize SVGs",
"longDescription": "Generate SVG images from text prompts or vectorize raster images into SVGs using QuiverAI. Supports reference images, style instructions, and multiple output generation.",
"bgColor": "#000000",
"iconName": "QuiverIcon",
"docsUrl": "https://docs.sim.ai/tools/quiver",
"operations": [
{
"name": "Text to SVG",
"description": "Generate SVG images from text prompts using QuiverAI"
},
{
"name": "Image to SVG",
"description": "Convert raster images into vector SVG format using QuiverAI"
},
{
"name": "List Models",
"description": "List all available QuiverAI models"
}
],
"operationCount": 3,
"triggers": [],
"triggerCount": 0,
"authType": "api-key",
"category": "tools",
"integrationType": "design",
"tags": ["image-generation"]
},
{
"type": "reddit",
"slug": "reddit",
Expand Down
141 changes: 141 additions & 0 deletions apps/sim/app/api/tools/quiver/image-to-svg/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { z } from 'zod'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { generateRequestId } from '@/lib/core/utils/request'
import { FileInputSchema, type RawFileInput } from '@/lib/uploads/utils/file-schemas'
import { processFilesToUserFiles } from '@/lib/uploads/utils/file-utils'
import { downloadFileFromStorage } from '@/lib/uploads/utils/file-utils.server'

const logger = createLogger('QuiverImageToSvgAPI')

const RequestSchema = z.object({
apiKey: z.string().min(1),
model: z.string().min(1),
image: z.union([FileInputSchema, z.string()]),
temperature: z.number().min(0).max(2).optional().nullable(),
top_p: z.number().min(0).max(1).optional().nullable(),
max_output_tokens: z.number().int().min(1).max(131072).optional().nullable(),
presence_penalty: z.number().min(-2).max(2).optional().nullable(),
auto_crop: z.boolean().optional().nullable(),
target_size: z.number().int().min(128).max(4096).optional().nullable(),
})

export async function POST(request: NextRequest) {
const requestId = generateRequestId()

const authResult = await checkInternalAuth(request, { requireWorkflowId: false })
if (!authResult.success) {
return NextResponse.json({ success: false, error: 'Unauthorized' }, { status: 401 })
}

try {
const body = await request.json()
const data = RequestSchema.parse(body)

let apiImage: { url: string } | { base64: string }

if (typeof data.image === 'string') {
try {
const parsed = JSON.parse(data.image)
if (parsed && typeof parsed === 'object') {
const userFiles = processFilesToUserFiles([parsed as RawFileInput], requestId, logger)
if (userFiles.length > 0) {
const buffer = await downloadFileFromStorage(userFiles[0], requestId, logger)
apiImage = { base64: buffer.toString('base64') }
} else {
return NextResponse.json(
{ success: false, error: 'Invalid file input' },
{ status: 400 }
)
}
} else {
apiImage = { url: data.image }
}
} catch {
apiImage = { url: data.image }
}
} else if (typeof data.image === 'object' && data.image !== null) {
const userFiles = processFilesToUserFiles([data.image as RawFileInput], requestId, logger)
if (userFiles.length > 0) {
const buffer = await downloadFileFromStorage(userFiles[0], requestId, logger)
apiImage = { base64: buffer.toString('base64') }
} else {
return NextResponse.json({ success: false, error: 'Invalid file input' }, { status: 400 })
}
} else {
return NextResponse.json({ success: false, error: 'Image is required' }, { status: 400 })
}

const apiBody: Record<string, unknown> = {
model: data.model,
image: apiImage,
}

if (data.temperature != null) apiBody.temperature = data.temperature
if (data.top_p != null) apiBody.top_p = data.top_p
if (data.max_output_tokens != null) apiBody.max_output_tokens = data.max_output_tokens
if (data.presence_penalty != null) apiBody.presence_penalty = data.presence_penalty
if (data.auto_crop != null) apiBody.auto_crop = data.auto_crop
if (data.target_size != null) apiBody.target_size = data.target_size

logger.info(`[${requestId}] Calling Quiver vectorization API with model: ${data.model}`)

const response = await fetch('https://api.quiver.ai/v1/svgs/vectorizations', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${data.apiKey}`,
},
body: JSON.stringify(apiBody),
})

if (!response.ok) {
const errorText = await response.text()
logger.error(`[${requestId}] Quiver API error: ${response.status} - ${errorText}`)
return NextResponse.json(
{ success: false, error: `Quiver API error: ${response.status} - ${errorText}` },
{ status: response.status }
)
}

const result = await response.json()

if (!result.data || result.data.length === 0) {
return NextResponse.json(
{ success: false, error: 'No SVG data returned from Quiver API' },
{ status: 500 }
)
}

const svgContent = result.data[0].svg
const svgBuffer = Buffer.from(svgContent, 'utf-8')
const file = {
name: 'vectorized.svg',
mimeType: 'image/svg+xml',
data: svgBuffer.toString('base64'),
size: svgBuffer.length,
}

return NextResponse.json({
success: true,
output: {
file,
files: [file],
svgContent,
id: result.id ?? null,
usage: result.usage
? {
totalTokens: result.usage.total_tokens ?? 0,
inputTokens: result.usage.input_tokens ?? 0,
outputTokens: result.usage.output_tokens ?? 0,
}
: null,
},
})
} catch (error) {
logger.error(`[${requestId}] Error in Quiver image-to-svg:`, error)
const message = error instanceof Error ? error.message : 'Unknown error'
return NextResponse.json({ success: false, error: message }, { status: 500 })
}
}
Loading
Loading