Code Examples
Code examples and tutorials to help you integrate Ddukddak into your applications.
Node.js
Node.js Quickstart
Get up and running with Ddukddak in Node.js. Install the SDK, authenticate, and generate your first image.
Python
Python Image Generation
Generate images with the Ddukddak Python SDK. Includes examples for dynamic text, images, and batch processing.
TypeScript
TypeScript Integration
Generate images and videos with Ddukddak in TypeScript. Type-safe API calls with full interface definitions.
Node.js
$ npm install @ddukddak/node
Node.js
const { Ddukddak } = require("@ddukddak/node");
const client = new Ddukddak("YOUR_API_KEY");
// Generate an image from a template
const image = await client.images.createAndWait({
template: "product-card",
properties: [
{ name: "title", text: "My Awesome Product Launch!" },
{ name: "background", image_url: "https://example.com/bg.jpg" },
{ name: "price", text: "$29.99", color: "#FF6B6B" },
],
});
console.log(image.image_url);
// Generate a video from a template
const video = await client.videos.createAndWait({
template: "story-promo",
input_media_url: "https://example.com/clip.mp4",
properties: [{ name: "title", text: "Summer Sale" }],
});
console.log(video.video_url);
// Generate an AI image
const aiImage = await client.aiImages.createAndWait({
prompt: "A minimalist product photo of a white sneaker",
model: "gemini-2.5-flash-image",
aspect_ratio: "1:1",
image_size: "1K",
});
console.log(aiImage.image_url);Python
$ pip install ddukddak
Python
from ddukddak import Ddukddak
client = Ddukddak("YOUR_API_KEY")
# Generate an image from a template
image = client.images.create_and_wait(
template="product-card",
properties=[
{"name": "title", "text": "My Awesome Product Launch!"},
{"name": "background", "image_url": "https://example.com/bg.jpg"},
{"name": "price", "text": "$29.99", "color": "#FF6B6B"},
],
)
print(image["image_url"])
# Generate a video from a template
video = client.videos.create_and_wait(
template="story-promo",
input_media_url="https://example.com/clip.mp4",
properties=[{"name": "title", "text": "Summer Sale"}],
)
print(video["video_url"])
# Generate an AI image
ai_image = client.ai_images.create_and_wait(
prompt="A minimalist product photo of a white sneaker",
model="gemini-2.5-flash-image",
aspect_ratio="1:1",
image_size="1K",
)
print(ai_image["image_url"])TypeScript
$ npm install ddukddak
TypeScript
import { Ddukddak } from "ddukddak";
const client = new Ddukddak("YOUR_API_KEY");
// Generate an image from a template
const image = await client.images.createAndWait({
template: "product-card",
properties: [
{ name: "title", text: "My Awesome Product Launch!" },
{ name: "background", image_url: "https://example.com/bg.jpg" },
{ name: "price", text: "$29.99", color: "#FF6B6B" },
],
});
console.log(image.image_url);
// Generate a video from a template
const video = await client.videos.createAndWait({
template: "story-promo",
input_media_url: "https://example.com/clip.mp4",
properties: [{ name: "title", text: "Summer Sale" }],
});
console.log(video.video_url);
// Generate an AI image
const aiImage = await client.aiImages.createAndWait({
prompt: "A minimalist product photo of a white sneaker",
model: "gemini-2.5-flash-image",
aspect_ratio: "1:1",
image_size: "1K",
});
console.log(aiImage.image_url);Ready to build?
Sign up for a free trial and start generating images in minutes.