@yetter/client 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/types.d.ts +7 -1
- package/examples/stream.ts +3 -3
- package/examples/submit.ts +1 -0
- package/examples/subscribe.ts +3 -1
- package/package.json +1 -1
- package/src/types.ts +8 -1
package/README.md
CHANGED
|
@@ -61,6 +61,7 @@ async function main() {
|
|
|
61
61
|
const result = await yetter.subscribe(model, {
|
|
62
62
|
input: {
|
|
63
63
|
prompt: "a vibrant coral reef, underwater photography",
|
|
64
|
+
num_inference_steps: 28, // Required
|
|
64
65
|
},
|
|
65
66
|
logs: true,
|
|
66
67
|
onQueueUpdate: (update) => {
|
|
@@ -120,6 +121,7 @@ async function main() {
|
|
|
120
121
|
const streamInstance = await yetter.stream(model, {
|
|
121
122
|
input: {
|
|
122
123
|
prompt: "a bioluminescent forest at night, fantasy art",
|
|
124
|
+
num_inference_steps: 28, // Required
|
|
123
125
|
},
|
|
124
126
|
});
|
|
125
127
|
streamRequestId = streamInstance.getRequestId();
|
|
@@ -189,6 +191,7 @@ async function main() {
|
|
|
189
191
|
const { request_id } = await yetter.queue.submit(model, {
|
|
190
192
|
input: {
|
|
191
193
|
prompt: "a fluffy white kitten playing with a yarn ball",
|
|
194
|
+
num_inference_steps: 28, // Required
|
|
192
195
|
},
|
|
193
196
|
});
|
|
194
197
|
console.log("Request ID:", request_id);
|
package/dist/types.d.ts
CHANGED
|
@@ -3,11 +3,17 @@ export interface ClientOptions {
|
|
|
3
3
|
endpoint?: string;
|
|
4
4
|
is_bearer?: boolean;
|
|
5
5
|
}
|
|
6
|
+
export interface LoraWeight {
|
|
7
|
+
path: string;
|
|
8
|
+
scale?: number;
|
|
9
|
+
}
|
|
6
10
|
export interface GenerateImageRequest {
|
|
7
11
|
model: string;
|
|
8
12
|
prompt: string;
|
|
9
|
-
num_inference_steps
|
|
13
|
+
num_inference_steps: number;
|
|
10
14
|
seed?: number;
|
|
15
|
+
loras?: LoraWeight[];
|
|
16
|
+
image_url?: string;
|
|
11
17
|
}
|
|
12
18
|
export interface GenerateImageResponse {
|
|
13
19
|
status: string;
|
package/examples/stream.ts
CHANGED
|
@@ -3,14 +3,14 @@ import { yetter } from "../src/client.js";
|
|
|
3
3
|
async function main() {
|
|
4
4
|
const model = "ytr-ai/flux/dev";
|
|
5
5
|
console.log("\n--- Starting Stream Test ---");
|
|
6
|
+
console.time("Stream Test");
|
|
6
7
|
let streamRequestId = "";
|
|
7
8
|
|
|
8
9
|
try {
|
|
9
10
|
const streamInstance = await yetter.stream(model, {
|
|
10
11
|
input: {
|
|
11
12
|
prompt: "a bioluminescent forest at night, fantasy art",
|
|
12
|
-
|
|
13
|
-
// You can add other parameters like seed or num_inference_steps here
|
|
13
|
+
num_inference_steps: 28,
|
|
14
14
|
},
|
|
15
15
|
});
|
|
16
16
|
streamRequestId = streamInstance.getRequestId();
|
|
@@ -37,7 +37,7 @@ async function main() {
|
|
|
37
37
|
console.log("No images in final result.");
|
|
38
38
|
}''
|
|
39
39
|
console.log("Original Prompt:", result.prompt);
|
|
40
|
-
|
|
40
|
+
console.timeEnd("Stream Test");
|
|
41
41
|
} catch (err: any) {
|
|
42
42
|
console.error(`\n--- Stream Test Failed (Request ID: ${streamRequestId || 'UNKNOWN'}) ---`);
|
|
43
43
|
console.error("Error during stream test:", err.message || err);
|
package/examples/submit.ts
CHANGED
package/examples/subscribe.ts
CHANGED
|
@@ -5,9 +5,11 @@ async function main() {
|
|
|
5
5
|
// Subscribe test
|
|
6
6
|
try {
|
|
7
7
|
console.log("\n--- Starting Subscribe Test ---");
|
|
8
|
+
console.time("Subscribe Test");
|
|
8
9
|
const result = await yetter.subscribe(model, {
|
|
9
10
|
input: {
|
|
10
11
|
prompt: "a vibrant coral reef, underwater photography",
|
|
12
|
+
num_inference_steps: 28,
|
|
11
13
|
},
|
|
12
14
|
logs: true,
|
|
13
15
|
onQueueUpdate: (update) => {
|
|
@@ -25,7 +27,7 @@ async function main() {
|
|
|
25
27
|
|
|
26
28
|
console.log("\n--- Subscribe Test Result ---");
|
|
27
29
|
console.log("Results:", result);
|
|
28
|
-
|
|
30
|
+
console.timeEnd("Subscribe Test");
|
|
29
31
|
} catch (err: any) {
|
|
30
32
|
console.error("\n--- Subscribe Test Failed ---");
|
|
31
33
|
console.error("Error during subscribe:", err.message || err);
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -4,11 +4,18 @@ export interface ClientOptions {
|
|
|
4
4
|
is_bearer?: boolean;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
export interface LoraWeight {
|
|
8
|
+
path: string;
|
|
9
|
+
scale?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
export interface GenerateImageRequest {
|
|
8
13
|
model: string;
|
|
9
14
|
prompt: string;
|
|
10
|
-
num_inference_steps
|
|
15
|
+
num_inference_steps: number;
|
|
11
16
|
seed?: number;
|
|
17
|
+
loras?: LoraWeight[];
|
|
18
|
+
image_url?: string;
|
|
12
19
|
}
|
|
13
20
|
|
|
14
21
|
export interface GenerateImageResponse {
|