Skip to content

Commit f5742b2

Browse files
sergio-eliot-rodriguezjocarinojoaojoaocoformjcortes
authored
Merging pull request #18362
* Leonardo AI components * added unzoom image action * fixing link errors * more lint fixes * Merging pull request #18359 * fix: pagination prop and params struct * fix: no need for paginate here * chore: update version * chore: cleanup * chore: update package * feat: allow raw response * chore: bump package * fix: buffer response instead * Update components/google_drive/actions/download-file/download-file.mjs Co-authored-by: Jorge Cortes <[email protected]> * versions * pnpm-lock.yaml * pnpm-lock.yaml * pnpm-lock.yaml * feat: add content selector * chore: bump package * fix: comments * chore: bump versions * chore: fix versions * fixes: QA fixes * feat: add cursor to req * package.json --------- Co-authored-by: joao <[email protected]> Co-authored-by: joaocoform <[email protected]> Co-authored-by: Jorge Cortes <[email protected]> Co-authored-by: Michelle Bergeron <[email protected]> Co-authored-by: Luan Cazarine <[email protected]> * Merging pull request #18361 * update siteId prop * pnpm-lock.yaml * package.json version * Google Sheets - update row refresh fields (#18369) * change prop order and refresh fields * bump package.json * Pipedrive - fix app name (#18370) * use pipedriveApp instead of app * bump package.json * Pipedrive - pipelineId integer (#18372) * pipelineId - integer * bump versions * Adding app scaffolding for lightspeed_ecom_c_series * Adding app scaffolding for financial_data * Adding app scaffolding for microsoft_authenticator * Merging pull request #18345 * updates * versions * versions * Merging pull request #18368 * updates * remove console.log * versions * Coinbase Developer Platform - New Wallet Event (#18342) * new component * pnpm-lock.yaml * updates * updates * Hubspot - update search-crm (#18360) * update search-crm * limit results to one page * update version * package.json version * Merging pull request #18347 * widget props * fix version * Adding app scaffolding for rundeck * Merging pull request #18378 * Update Taiga component with new actions and sources - Bump version to 0.1.0 in package.json and add dependency on @pipedream/platform. - Introduce new actions for creating, updating, and deleting issues, tasks, and user stories. - Add sources for tracking changes and deletions of issues and tasks. - Implement utility functions for parsing and cleaning objects in common/utils.mjs. - Enhance prop definitions for better integration with Taiga API. * pnpm update * Refactor Taiga actions to utilize parseObject utility - Added parseObject utility for tags, watchers, and points in update-issue, update-task, and update-userstory actions. - Removed the update-project action as it is no longer needed. - Enhanced base source to include secret key validation for webhook security. * Merging pull request #18382 * add testSources prop * pnpm-lock.yaml * fix * Merging pull request #18323 * Added actions * Added actions * Added actions * Merging pull request #18377 * Added actions * Update components/weaviate/actions/create-class/create-class.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Luan Cazarine <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Merging pull request #18376 * Adding app scaffolding for etrusted * Adding app scaffolding for intelliflo_office * Adding app scaffolding for thoughtspot * Adding app scaffolding for kordiam * Adding app scaffolding for ticketsauce * trustpilot fixes (#18152) * trustpilot fixes * more fixes * update versions * more version updates * fixes * Bump all Trustpilot actions to version 0.1.0 Major improvements and API updates across all actions: - Enhanced private API support with proper authentication - Improved parameter handling and validation - Better error handling and response structures - Added new conversation flow for product reviews - Fixed endpoint URLs to match latest API documentation - Streamlined request/response processing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * up version and clean up sources * merge * fix business ID * delete temp action * Update components/trustpilot/sources/new-product-reviews/new-product-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/trustpilot/sources/new-product-reviews/new-product-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/trustpilot/sources/new-product-reviews/new-product-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/trustpilot/sources/new-service-reviews/new-service-reviews.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * comments * Pagination * fixes * comments * missed some `$`'s * unduplicated * more fixes * final comments * more comments * . --------- Co-authored-by: Claude <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Adding app scaffolding for peekalink * 18314 twilio (#18350) * Update Twilio component versions and dependencies - Update Twilio Send Message action adding detailed description for 'from' prop and refactoring phone number validation logic. - Incremented action versions for several Twilio actions. * pnpm update * Updating LinkedIn API version (#18399) * Merging pull request #18394 * Databricks API - Jobs action components (#18371) * Notion property building improvements (#18381) * validate property types * versions * Google Business - add debug log (#18407) * add debug log * bump versions * Notion API Key - update @pipedream/notion version (#18409) * update @pipedream/notion dependency version * pnpm-lock.yaml * Adding app scaffolding for reduct_video * Adding app scaffolding for shopware * Adding app scaffolding for instamojo * Hubspot - bug fix to sources w/ property changes (#18379) * updates * versions * Google sheets type fix (#18411) * Fixing worksheetId prop type from string to integer * Version bumps --------- Co-authored-by: Leo Vu <[email protected]> * Merging pull request #18393 * new components * remove console.log * versions * update * Merging pull request #18408 * 403 error message * versions * update * Merging pull request #18419 * Changes per PR Review * Removes leonardo_ai_actions.mdc not indented for merging * synced lockfile after install * fully lock form-data for leonardo_ai * conflict solving * lint fixes * Chipped down Readme, implemented async options in gen motion --------- Co-authored-by: jocarino <[email protected]> Co-authored-by: joao <[email protected]> Co-authored-by: joaocoform <[email protected]> Co-authored-by: Jorge Cortes <[email protected]> Co-authored-by: Michelle Bergeron <[email protected]> Co-authored-by: Luan Cazarine <[email protected]> Co-authored-by: michelle0927 <[email protected]> Co-authored-by: Andrew Chuang <[email protected]> Co-authored-by: danhsiung <[email protected]> Co-authored-by: Lucas Caresia <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Job <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: Guilherme Falcão <[email protected]> Co-authored-by: Leo Vu <[email protected]>
1 parent 4f0794a commit f5742b2

File tree

9 files changed

+531
-6
lines changed

9 files changed

+531
-6
lines changed

components/leonardo_ai/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Leonardo AI
2+
3+
[Leonardo AI](https://leonardo.ai) is an AI-powered image generation platform that allows you to create stunning images, videos, and 3D models using advanced machine learning models.
4+
5+
## API Reference
6+
7+
For detailed information about Leonardo AI's API, visit the [official documentation](https://docs.leonardo.ai/reference).
8+
9+
## Support
10+
11+
For support with this component or Leonardo AI's API, please refer to:
12+
- [Leonardo AI Documentation](https://docs.leonardo.ai)
13+
- [Leonardo AI Community](https://community.leonardo.ai)
14+
- [Pipedream Support](https://pipedream.com/support)
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
import app from "../../leonardo_ai.app.mjs";
2+
3+
export default {
4+
key: "leonardo_ai-generate-image",
5+
name: "Generate Image",
6+
description: "Generates new images using Leonardo AI's image generation API. [See the documentation](https://docs.leonardo.ai/reference/creategeneration)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
prompt: {
12+
type: "string",
13+
label: "Prompt",
14+
description: "The text prompt describing the image you want to generate.",
15+
},
16+
modelId: {
17+
type: "string",
18+
label: "Model",
19+
description: "The model to use for generation. Leave empty to use the default model.",
20+
async options() {
21+
const models = await this.app.getPlatformModels();
22+
return models.map((model) => ({
23+
label: model.name || model.id,
24+
value: model.id,
25+
}));
26+
},
27+
optional: true,
28+
},
29+
width: {
30+
type: "integer",
31+
label: "Width",
32+
description: "Width of the generated image in pixels.",
33+
default: 1024,
34+
min: 32,
35+
max: 1536,
36+
},
37+
height: {
38+
type: "integer",
39+
label: "Height",
40+
description: "Height of the generated image in pixels.",
41+
default: 768,
42+
min: 32,
43+
max: 1536,
44+
},
45+
numImages: {
46+
type: "integer",
47+
label: "Number of Images",
48+
description: "Number of images to generate (1-8). If either width or height is over 768, must be between 1 and 4.",
49+
default: 1,
50+
min: 1,
51+
max: 8,
52+
},
53+
guidanceScale: {
54+
type: "integer",
55+
label: "Guidance Scale",
56+
description: "How closely the model should follow the prompt. Must be between 1 and 20. Higher values = more adherence to prompt.",
57+
default: 7,
58+
min: 1,
59+
max: 20,
60+
optional: true,
61+
},
62+
numInferenceSteps: {
63+
type: "integer",
64+
label: "Inference Steps",
65+
description: "Number of denoising steps. More steps = higher quality but slower generation.",
66+
default: 15,
67+
min: 10,
68+
max: 60,
69+
optional: true,
70+
},
71+
seed: {
72+
type: "integer",
73+
label: "Seed",
74+
description: "Random seed for reproducible generation. Leave empty for random generation.",
75+
optional: true,
76+
},
77+
},
78+
async run({ $ }) {
79+
const {
80+
prompt,
81+
modelId,
82+
width,
83+
height,
84+
numImages,
85+
guidanceScale,
86+
numInferenceSteps,
87+
seed,
88+
} = this;
89+
90+
const data = {
91+
prompt,
92+
width,
93+
height,
94+
num_images: numImages,
95+
modelId,
96+
guidance_scale: guidanceScale,
97+
num_inference_steps: numInferenceSteps,
98+
seed,
99+
};
100+
101+
const response = await this.app._makeRequest({
102+
$,
103+
method: "POST",
104+
path: "/generations",
105+
data,
106+
});
107+
108+
$.export("$summary", `Successfully generated ${numImages} image(s)`);
109+
return response;
110+
},
111+
};
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
import app from "../../leonardo_ai.app.mjs";
2+
3+
export default {
4+
key: "leonardo_ai-generate-motion",
5+
name: "Generate Motion",
6+
description: "Generates a motion (video) from the provided image using Leonardo AI's SVD Motion Generation API. [See the documentation](https://docs.leonardo.ai/reference/createsvdmotiongeneration)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
imageId: {
12+
type: "string",
13+
label: "Image ID",
14+
description: "The ID of the image to generate motion from. You can either select from previously generated images or manually enter the ID of an uploaded image.",
15+
async options({ prevContext }) {
16+
// Get user info to retrieve userId
17+
const userInfo = await this.app.getUserInfo({
18+
$: this,
19+
});
20+
// Extract userId from the response structure
21+
const userId = userInfo.user_details?.[0]?.user?.id || userInfo.id;
22+
23+
// Get generations with pagination
24+
const offset = prevContext?.offset || 0;
25+
const limit = 20;
26+
27+
const generations = await this.app.getGenerationsByUserId({
28+
$: this,
29+
userId,
30+
offset,
31+
limit,
32+
});
33+
34+
// Extract image IDs from generated_images array
35+
const options = [];
36+
if (generations.generations) {
37+
for (const generation of generations.generations) {
38+
if (generation.generated_images) {
39+
for (const image of generation.generated_images) {
40+
options.push({
41+
label: `Image ${image.id} (Generation ${generation.id})`,
42+
value: image.id,
43+
});
44+
}
45+
}
46+
}
47+
}
48+
49+
// Check if there are more pages
50+
const hasMore = generations.generations && generations.generations.length === limit;
51+
const nextOffset = hasMore
52+
? offset + limit
53+
: null;
54+
55+
return {
56+
options,
57+
context: nextOffset
58+
? {
59+
offset: nextOffset,
60+
}
61+
: {},
62+
};
63+
},
64+
},
65+
motionStrength: {
66+
type: "integer",
67+
label: "Motion Strength",
68+
description: "The motion strength for the video generation.",
69+
optional: true,
70+
},
71+
isPublic: {
72+
type: "boolean",
73+
label: "Is Public",
74+
description: "Whether the generation is public or not.",
75+
optional: true,
76+
},
77+
isInitImage: {
78+
type: "boolean",
79+
label: "Is Init Image",
80+
description: "Whether the image being used is an init image uploaded by the user.",
81+
optional: true,
82+
},
83+
isVariation: {
84+
type: "boolean",
85+
label: "Is Variation",
86+
description: "Whether the image being used is a variation image.",
87+
optional: true,
88+
},
89+
},
90+
async run({ $ }) {
91+
const {
92+
imageId,
93+
motionStrength,
94+
isPublic,
95+
isInitImage,
96+
isVariation,
97+
} = this;
98+
99+
const data = {
100+
imageId,
101+
motionStrength,
102+
isPublic,
103+
isInitImage,
104+
isVariation,
105+
};
106+
107+
const response = await this.app._makeRequest({
108+
$,
109+
method: "POST",
110+
path: "/generations-motion-svd",
111+
data,
112+
});
113+
114+
$.export("$summary", `Successfully generated motion from image ID: ${imageId}`);
115+
return response;
116+
},
117+
};
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import app from "../../leonardo_ai.app.mjs";
2+
3+
export default {
4+
key: "leonardo_ai-unzoom-image",
5+
name: "Unzoom Image",
6+
description: "Creates an unzoom variation for a generated or variation image using Leonardo AI's unzoom API. [See the documentation](https://docs.leonardo.ai/reference/createvariationunzoom)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
imageId: {
12+
type: "string",
13+
label: "Image ID",
14+
description: "The ID of the image to create an unzoom variation for. This should be a previously generated or variation image ID.",
15+
},
16+
isVariation: {
17+
type: "boolean",
18+
label: "Is Variation",
19+
description: "Whether the image is a variation image.",
20+
default: false,
21+
},
22+
},
23+
async run({ $ }) {
24+
const {
25+
imageId,
26+
isVariation,
27+
} = this;
28+
29+
const data = {
30+
id: imageId,
31+
isVariation,
32+
};
33+
34+
const response = await this.app._makeRequest({
35+
$,
36+
method: "POST",
37+
path: "/variations/unzoom",
38+
data,
39+
});
40+
41+
$.export("$summary", `Successfully created unzoom variation for image ID: ${imageId}`);
42+
return response;
43+
},
44+
};
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
import app from "../../leonardo_ai.app.mjs";
2+
import FormData from "form-data";
3+
import { getFileStreamAndMetadata } from "@pipedream/platform";
4+
5+
export default {
6+
key: "leonardo_ai-upload-image",
7+
name: "Upload Image",
8+
description: "Uploads a new image to Leonardo AI for use in generations and variations. [See the documentation](https://docs.leonardo.ai/docs/how-to-upload-an-image-using-a-presigned-url)",
9+
version: "0.0.1",
10+
type: "action",
11+
props: {
12+
app,
13+
extension: {
14+
type: "string",
15+
label: "File Extension",
16+
description: "The file extension of the image to upload.",
17+
options: [
18+
{
19+
label: "PNG",
20+
value: "png",
21+
},
22+
{
23+
label: "JPG",
24+
value: "jpg",
25+
},
26+
{
27+
label: "JPEG",
28+
value: "jpeg",
29+
},
30+
{
31+
label: "WebP",
32+
value: "webp",
33+
},
34+
],
35+
},
36+
filePath: {
37+
type: "string",
38+
label: "File Path or URL",
39+
description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myImage.png`)",
40+
},
41+
syncDir: {
42+
type: "dir",
43+
accessMode: "read",
44+
sync: true,
45+
optional: true,
46+
},
47+
},
48+
async run({ $ }) {
49+
const {
50+
extension,
51+
filePath,
52+
} = this;
53+
// Get file stream from URL or /tmp based path
54+
const {
55+
stream,
56+
metadata,
57+
} = await getFileStreamAndMetadata(filePath);
58+
59+
// Step 1: Get the presigned URL, upload fields appended to formData
60+
const uploadResponse = await this.app.getUploadInitImage({
61+
$,
62+
extension,
63+
});
64+
65+
const { uploadInitImage } = uploadResponse;
66+
const fields = JSON.parse(uploadInitImage.fields);
67+
const formData = new FormData();
68+
69+
//Important: Order of fields is sanctioned by Leonardo AI API. Fields go first, then the file
70+
for (const [
71+
label,
72+
value,
73+
] of Object.entries(fields)) {
74+
formData.append(label, value.toString());
75+
}
76+
formData.append("file", stream, {
77+
contentType: metadata.contentType,
78+
knownLength: metadata.size,
79+
filename: metadata.name,
80+
});
81+
const uploadUrl = uploadInitImage.url;
82+
83+
// Step 2: Upload the file to the presigned URL
84+
const uploadResult = await this.app.uploadFileToPresignedUrl({
85+
$,
86+
url: uploadUrl,
87+
formData,
88+
});
89+
90+
$.export("$summary", `Successfully uploaded image: ${metadata.name || filePath}`);
91+
return {
92+
uploadInitImage,
93+
uploadResult,
94+
};
95+
},
96+
};

0 commit comments

Comments
 (0)