Skip to content

Commit 5fbe2f3

Browse files
authored
Merge branch 'master' into issue-13865
2 parents 97fdb73 + 31906cf commit 5fbe2f3

File tree

7 files changed

+405
-7
lines changed

7 files changed

+405
-7
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "jina_reader",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/jina_reader",
3+
"version": "0.0.1",
4+
"description": "Pipedream Jina Reader Components",
5+
"main": "jina_reader.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"jina_reader"
9+
],
10+
"homepage": "https://pipedream.com/apps/jina_reader",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
import { v4 as uuid } from "uuid";
2+
import app from "../../runware.app.mjs";
3+
4+
export default {
5+
key: "runware-request-task",
6+
name: "Request Task",
7+
description: "Request one task to be processed by the Runware API. [See the documentation](https://docs.runware.ai/en/image-inference/api-reference).",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
app,
12+
taskType: {
13+
propDefinition: [
14+
app,
15+
"taskType",
16+
],
17+
},
18+
outputType: {
19+
propDefinition: [
20+
app,
21+
"outputType",
22+
],
23+
},
24+
outputFormat: {
25+
propDefinition: [
26+
app,
27+
"outputFormat",
28+
],
29+
},
30+
uploadEndpoint: {
31+
propDefinition: [
32+
app,
33+
"uploadEndpoint",
34+
],
35+
},
36+
checkNSFW: {
37+
propDefinition: [
38+
app,
39+
"checkNSFW",
40+
],
41+
},
42+
includeCost: {
43+
propDefinition: [
44+
app,
45+
"includeCost",
46+
],
47+
},
48+
positivePrompt: {
49+
propDefinition: [
50+
app,
51+
"positivePrompt",
52+
],
53+
},
54+
negativePrompt: {
55+
propDefinition: [
56+
app,
57+
"negativePrompt",
58+
],
59+
},
60+
seedImage: {
61+
propDefinition: [
62+
app,
63+
"seedImage",
64+
],
65+
},
66+
maskImage: {
67+
propDefinition: [
68+
app,
69+
"maskImage",
70+
],
71+
},
72+
strength: {
73+
propDefinition: [
74+
app,
75+
"strength",
76+
],
77+
},
78+
height: {
79+
propDefinition: [
80+
app,
81+
"height",
82+
],
83+
},
84+
width: {
85+
propDefinition: [
86+
app,
87+
"width",
88+
],
89+
},
90+
model: {
91+
propDefinition: [
92+
app,
93+
"model",
94+
],
95+
},
96+
steps: {
97+
propDefinition: [
98+
app,
99+
"steps",
100+
],
101+
},
102+
scheduler: {
103+
propDefinition: [
104+
app,
105+
"scheduler",
106+
],
107+
},
108+
seed: {
109+
propDefinition: [
110+
app,
111+
"seed",
112+
],
113+
},
114+
numberResults: {
115+
propDefinition: [
116+
app,
117+
"numberResults",
118+
],
119+
},
120+
},
121+
async run({ $ }) {
122+
const {
123+
app,
124+
taskType,
125+
outputType,
126+
outputFormat,
127+
uploadEndpoint,
128+
checkNSFW,
129+
includeCost,
130+
positivePrompt,
131+
negativePrompt,
132+
seedImage,
133+
maskImage,
134+
strength,
135+
height,
136+
width,
137+
model,
138+
steps,
139+
scheduler,
140+
seed,
141+
numberResults,
142+
} = this;
143+
144+
const response = await app.post({
145+
$,
146+
data: [
147+
{
148+
taskUUID: uuid(),
149+
taskType,
150+
outputType,
151+
outputFormat,
152+
uploadEndpoint,
153+
checkNSFW,
154+
includeCost,
155+
positivePrompt,
156+
negativePrompt,
157+
seedImage,
158+
maskImage,
159+
strength,
160+
height,
161+
width,
162+
model,
163+
steps,
164+
scheduler,
165+
seed: seed
166+
? parseInt(seed)
167+
: undefined,
168+
numberResults,
169+
},
170+
],
171+
});
172+
173+
$.export("$summary", `Successfully requested task with UUID \`${response.data[0].taskUUID}\`.`);
174+
return response;
175+
},
176+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const BASE_URL = "https://api.runware.ai";
2+
const VERSION_PATH = "/v1";
3+
4+
const TASK_TYPE = {
5+
IMAGE_INFERENCE: {
6+
value: "imageInference",
7+
label: "Image Inference",
8+
},
9+
IMAGE_CONTROL_NET_PREPROCESS: {
10+
value: "imageControlNetPreProcess",
11+
label: "Image Control Net Preprocess",
12+
},
13+
IMAGE_UPSCALE: {
14+
value: "imageUpscale",
15+
label: "Image Upscale",
16+
},
17+
IMAGE_BACKGROUND_REMOVAL: {
18+
value: "imageBackgroundRemoval",
19+
label: "Image Background Removal",
20+
},
21+
IMAGE_CAPTION: {
22+
value: "imageCaption",
23+
label: "Image Caption",
24+
},
25+
PROMPT_ENHANCE: {
26+
value: "promptEnhance",
27+
label: "Prompt Enhance",
28+
},
29+
};
30+
31+
export default {
32+
BASE_URL,
33+
VERSION_PATH,
34+
TASK_TYPE,
35+
};

components/runware/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/runware",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream Runware Components",
55
"main": "runware.app.mjs",
66
"keywords": [
@@ -11,5 +11,9 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "3.0.3",
17+
"uuid": "^10.0.0"
1418
}
15-
}
19+
}

0 commit comments

Comments
 (0)