@nodetool-ai/huggingface-nodes 0.8.1
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 +43 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/huggingface-base.d.ts +140 -0
- package/dist/huggingface-base.d.ts.map +1 -0
- package/dist/huggingface-base.js +279 -0
- package/dist/huggingface-base.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/audio.d.ts +46 -0
- package/dist/nodes/audio.d.ts.map +1 -0
- package/dist/nodes/audio.js +132 -0
- package/dist/nodes/audio.js.map +1 -0
- package/dist/nodes/image.d.ts +126 -0
- package/dist/nodes/image.d.ts.map +1 -0
- package/dist/nodes/image.js +382 -0
- package/dist/nodes/image.js.map +1 -0
- package/dist/nodes/text.d.ts +227 -0
- package/dist/nodes/text.d.ts.map +1 -0
- package/dist/nodes/text.js +702 -0
- package/dist/nodes/text.js.map +1 -0
- package/dist/nodes/video.d.ts +34 -0
- package/dist/nodes/video.d.ts.map +1 -0
- package/dist/nodes/video.js +112 -0
- package/dist/nodes/video.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { BaseNode, prop } from "@nodetool-ai/node-sdk";
|
|
8
|
+
import { getHfToken, hfPipelineJson, jsonArray, jsonObject, jsonString, refToBase64 } from "../huggingface-base.js";
|
|
9
|
+
const EMPTY_AUDIO = {
|
|
10
|
+
type: "audio",
|
|
11
|
+
uri: "",
|
|
12
|
+
asset_id: null,
|
|
13
|
+
data: null,
|
|
14
|
+
metadata: null
|
|
15
|
+
};
|
|
16
|
+
/** The ASR request body, with `parameters` present only when timestamps are asked for. */
|
|
17
|
+
function asrBody(inputs, returnTimestamps) {
|
|
18
|
+
const body = { inputs };
|
|
19
|
+
if (returnTimestamps) {
|
|
20
|
+
body.parameters = { return_timestamps: true };
|
|
21
|
+
}
|
|
22
|
+
return body;
|
|
23
|
+
}
|
|
24
|
+
export class AutomaticSpeechRecognitionNode extends BaseNode {
|
|
25
|
+
static nodeType = "huggingface.AutomaticSpeechRecognition";
|
|
26
|
+
static title = "Automatic Speech Recognition";
|
|
27
|
+
static description = "Transcribe audio to text (speech-to-text) via Hugging Face Inference Providers.\n" +
|
|
28
|
+
"audio, asr, speech-to-text, stt, transcription, whisper, huggingface\n\n" +
|
|
29
|
+
"Use cases:\n" +
|
|
30
|
+
"- Transcribe recordings and podcasts\n" +
|
|
31
|
+
"- Generate subtitles\n" +
|
|
32
|
+
"- Build voice interfaces";
|
|
33
|
+
static inputFields = ["audio"];
|
|
34
|
+
static requiredSettings = ["HF_TOKEN"];
|
|
35
|
+
static metadataOutputTypes = { output: "str", chunks: "list" };
|
|
36
|
+
async process(context) {
|
|
37
|
+
const token = getHfToken(this._secrets);
|
|
38
|
+
const audio = this.audio;
|
|
39
|
+
if (!audio || (!audio.uri && !audio.data)) {
|
|
40
|
+
throw new Error("Input audio is required");
|
|
41
|
+
}
|
|
42
|
+
const base64 = await refToBase64(audio, context);
|
|
43
|
+
const returnTimestamps = Boolean(this.return_timestamps ?? false);
|
|
44
|
+
const result = jsonObject(await hfPipelineJson(token, String(this.model ?? "openai/whisper-large-v3"), asrBody(base64, returnTimestamps)));
|
|
45
|
+
return {
|
|
46
|
+
output: jsonString(result["text"]),
|
|
47
|
+
chunks: jsonArray(result["chunks"])
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
__decorate([
|
|
52
|
+
prop({
|
|
53
|
+
type: "str",
|
|
54
|
+
default: "openai/whisper-large-v3",
|
|
55
|
+
title: "Model",
|
|
56
|
+
description: "Automatic-speech-recognition model repo id."
|
|
57
|
+
})
|
|
58
|
+
], AutomaticSpeechRecognitionNode.prototype, "model", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
prop({
|
|
61
|
+
type: "audio",
|
|
62
|
+
default: EMPTY_AUDIO,
|
|
63
|
+
title: "Audio",
|
|
64
|
+
description: "The audio to transcribe."
|
|
65
|
+
})
|
|
66
|
+
], AutomaticSpeechRecognitionNode.prototype, "audio", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
prop({
|
|
69
|
+
type: "bool",
|
|
70
|
+
default: false,
|
|
71
|
+
title: "Return Timestamps",
|
|
72
|
+
description: "Also return per-chunk timestamps."
|
|
73
|
+
})
|
|
74
|
+
], AutomaticSpeechRecognitionNode.prototype, "return_timestamps", void 0);
|
|
75
|
+
export class AudioClassificationNode extends BaseNode {
|
|
76
|
+
static nodeType = "huggingface.AudioClassification";
|
|
77
|
+
static title = "Audio Classification";
|
|
78
|
+
static description = "Assign a label / class to an audio clip.\n" +
|
|
79
|
+
"audio, classification, sound, label, huggingface\n\n" +
|
|
80
|
+
"Use cases:\n" +
|
|
81
|
+
"- Detect spoken language\n" +
|
|
82
|
+
"- Classify sounds or music genres\n" +
|
|
83
|
+
"- Emotion / keyword spotting";
|
|
84
|
+
static inputFields = ["audio"];
|
|
85
|
+
static requiredSettings = ["HF_TOKEN"];
|
|
86
|
+
static metadataOutputTypes = { output: "str", scores: "list" };
|
|
87
|
+
async process(context) {
|
|
88
|
+
const token = getHfToken(this._secrets);
|
|
89
|
+
const audio = this.audio;
|
|
90
|
+
if (!audio || (!audio.uri && !audio.data)) {
|
|
91
|
+
throw new Error("Input audio is required");
|
|
92
|
+
}
|
|
93
|
+
const base64 = await refToBase64(audio, context);
|
|
94
|
+
const result = await hfPipelineJson(token, String(this.model ?? "superb/hubert-base-superb-er"), {
|
|
95
|
+
inputs: base64,
|
|
96
|
+
parameters: { top_k: Number(this.top_k ?? 5) }
|
|
97
|
+
});
|
|
98
|
+
const scores = jsonArray(result);
|
|
99
|
+
return { output: jsonString(jsonObject(scores[0])["label"]), scores };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
__decorate([
|
|
103
|
+
prop({
|
|
104
|
+
type: "str",
|
|
105
|
+
default: "superb/hubert-base-superb-er",
|
|
106
|
+
title: "Model",
|
|
107
|
+
description: "Audio-classification model repo id."
|
|
108
|
+
})
|
|
109
|
+
], AudioClassificationNode.prototype, "model", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
prop({
|
|
112
|
+
type: "audio",
|
|
113
|
+
default: EMPTY_AUDIO,
|
|
114
|
+
title: "Audio",
|
|
115
|
+
description: "The audio to classify."
|
|
116
|
+
})
|
|
117
|
+
], AudioClassificationNode.prototype, "audio", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
prop({
|
|
120
|
+
type: "int",
|
|
121
|
+
default: 5,
|
|
122
|
+
title: "Top K",
|
|
123
|
+
description: "Return the top K most probable classes.",
|
|
124
|
+
min: 1,
|
|
125
|
+
max: 100
|
|
126
|
+
})
|
|
127
|
+
], AudioClassificationNode.prototype, "top_k", void 0);
|
|
128
|
+
export const HUGGINGFACE_AUDIO_NODES = [
|
|
129
|
+
AutomaticSpeechRecognitionNode,
|
|
130
|
+
AudioClassificationNode
|
|
131
|
+
];
|
|
132
|
+
//# sourceMappingURL=audio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio.js","sourceRoot":"","sources":["../../src/nodes/audio.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE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QACb,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,wBAAwB;KACtC,CAAC;sDACsB;AAUhB;IARP,IAAI,CAAC;QACJ,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,yCAAyC;QACtD,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,GAAG;KACT,CAAC;sDACoB;AA0BxB,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,8BAA8B;IAC9B,uBAAuB;CACxB,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { BaseNode } from "@nodetool-ai/node-sdk";
|
|
2
|
+
import type { NodeClass } from "@nodetool-ai/node-sdk";
|
|
3
|
+
import { type HfJsonValue, type MediaRef } from "../huggingface-base.js";
|
|
4
|
+
/** Output handles TextToImageNode.process() emits. */
|
|
5
|
+
type TextToImageNodeOutputs = {
|
|
6
|
+
output: {
|
|
7
|
+
type: string;
|
|
8
|
+
data: string;
|
|
9
|
+
content_type: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare class TextToImageNode extends BaseNode {
|
|
13
|
+
static readonly nodeType = "huggingface.TextToImage";
|
|
14
|
+
static readonly body = "content_card";
|
|
15
|
+
static readonly title = "Text to Image";
|
|
16
|
+
static readonly description: string;
|
|
17
|
+
static readonly inlineFields: string[];
|
|
18
|
+
static readonly requiredSettings: string[];
|
|
19
|
+
static readonly autoSaveAsset = true;
|
|
20
|
+
static readonly metadataOutputTypes: {
|
|
21
|
+
output: string;
|
|
22
|
+
};
|
|
23
|
+
model: string;
|
|
24
|
+
prompt: string;
|
|
25
|
+
negative_prompt: string;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
guidance_scale: number;
|
|
29
|
+
num_inference_steps: number;
|
|
30
|
+
seed: number;
|
|
31
|
+
process(): Promise<TextToImageNodeOutputs>;
|
|
32
|
+
}
|
|
33
|
+
/** Output handles ImageToImageNode.process() emits. */
|
|
34
|
+
type ImageToImageNodeOutputs = {
|
|
35
|
+
output: {
|
|
36
|
+
type: string;
|
|
37
|
+
data: string;
|
|
38
|
+
content_type: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare class ImageToImageNode extends BaseNode {
|
|
42
|
+
static readonly nodeType = "huggingface.ImageToImage";
|
|
43
|
+
static readonly body = "content_card";
|
|
44
|
+
static readonly title = "Image to Image";
|
|
45
|
+
static readonly description: string;
|
|
46
|
+
static readonly inlineFields: string[];
|
|
47
|
+
static readonly inputFields: string[];
|
|
48
|
+
static readonly requiredSettings: string[];
|
|
49
|
+
static readonly autoSaveAsset = true;
|
|
50
|
+
static readonly metadataOutputTypes: {
|
|
51
|
+
output: string;
|
|
52
|
+
};
|
|
53
|
+
model: string;
|
|
54
|
+
image: MediaRef;
|
|
55
|
+
prompt: string;
|
|
56
|
+
negative_prompt: string;
|
|
57
|
+
guidance_scale: number;
|
|
58
|
+
num_inference_steps: number;
|
|
59
|
+
process(context?: Parameters<BaseNode["process"]>[0]): Promise<ImageToImageNodeOutputs>;
|
|
60
|
+
}
|
|
61
|
+
/** Output handles ImageClassificationNode.process() emits. */
|
|
62
|
+
type ImageClassificationNodeOutputs = {
|
|
63
|
+
output: string;
|
|
64
|
+
scores: HfJsonValue[];
|
|
65
|
+
};
|
|
66
|
+
export declare class ImageClassificationNode extends BaseNode {
|
|
67
|
+
static readonly nodeType = "huggingface.ImageClassification";
|
|
68
|
+
static readonly title = "Image Classification";
|
|
69
|
+
static readonly description: string;
|
|
70
|
+
static readonly inputFields: string[];
|
|
71
|
+
static readonly requiredSettings: string[];
|
|
72
|
+
static readonly metadataOutputTypes: {
|
|
73
|
+
output: string;
|
|
74
|
+
scores: string;
|
|
75
|
+
};
|
|
76
|
+
model: string;
|
|
77
|
+
image: MediaRef;
|
|
78
|
+
top_k: number;
|
|
79
|
+
process(context?: Parameters<BaseNode["process"]>[0]): Promise<ImageClassificationNodeOutputs>;
|
|
80
|
+
}
|
|
81
|
+
/** Output handles ImageSegmentationNode.process() emits. */
|
|
82
|
+
type ImageSegmentationNodeOutputs = {
|
|
83
|
+
output: {
|
|
84
|
+
label: string;
|
|
85
|
+
score: number | null;
|
|
86
|
+
mask: {
|
|
87
|
+
type: string;
|
|
88
|
+
data: string;
|
|
89
|
+
content_type: string;
|
|
90
|
+
} | null;
|
|
91
|
+
}[];
|
|
92
|
+
};
|
|
93
|
+
export declare class ImageSegmentationNode extends BaseNode {
|
|
94
|
+
static readonly nodeType = "huggingface.ImageSegmentation";
|
|
95
|
+
static readonly title = "Image Segmentation";
|
|
96
|
+
static readonly description: string;
|
|
97
|
+
static readonly inputFields: string[];
|
|
98
|
+
static readonly requiredSettings: string[];
|
|
99
|
+
static readonly metadataOutputTypes: {
|
|
100
|
+
output: string;
|
|
101
|
+
};
|
|
102
|
+
model: string;
|
|
103
|
+
image: MediaRef;
|
|
104
|
+
process(context?: Parameters<BaseNode["process"]>[0]): Promise<ImageSegmentationNodeOutputs>;
|
|
105
|
+
}
|
|
106
|
+
/** Output handles ObjectDetectionNode.process() emits. */
|
|
107
|
+
type ObjectDetectionNodeOutputs = {
|
|
108
|
+
output: HfJsonValue[];
|
|
109
|
+
};
|
|
110
|
+
export declare class ObjectDetectionNode extends BaseNode {
|
|
111
|
+
static readonly nodeType = "huggingface.ObjectDetection";
|
|
112
|
+
static readonly title = "Object Detection";
|
|
113
|
+
static readonly description: string;
|
|
114
|
+
static readonly inputFields: string[];
|
|
115
|
+
static readonly requiredSettings: string[];
|
|
116
|
+
static readonly metadataOutputTypes: {
|
|
117
|
+
output: string;
|
|
118
|
+
};
|
|
119
|
+
model: string;
|
|
120
|
+
image: MediaRef;
|
|
121
|
+
threshold: number;
|
|
122
|
+
process(context?: Parameters<BaseNode["process"]>[0]): Promise<ObjectDetectionNodeOutputs>;
|
|
123
|
+
}
|
|
124
|
+
export declare const HUGGINGFACE_IMAGE_NODES: readonly NodeClass[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AAC,CA2BvC;CACF;AAED,0DAA0D;AAC1D,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB,CAAC;AAEF,qBAAa,mBAAoB,SAAQ,QAAQ;IAC/C,MAAM,CAAC,QAAQ,CAAC,QAAQ,iCAAiC;IACzD,MAAM,CAAC,QAAQ,CAAC,KAAK,sBAAsB;IAC3C,MAAM,CAAC,QAAQ,CAAC,WAAW,SAME;IAC7B,MAAM,CAAC,QAAQ,CAAC,WAAW,WAAa;IACxC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,WAAgB;IAChD,MAAM,CAAC,QAAQ,CAAC,mBAAmB;QAAK,MAAM;MAAW;IAQjD,KAAK,EAAE,MAAM,CAAC;IAQd,KAAK,EAAE,QAAQ,CAAC;IAUhB,SAAS,EAAE,MAAM,CAAC;IAEpB,OAAO,CACX,OAAO,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAC3C,OAAO,CAAC,0BAA0B,CAAC,CAkBrC;CACF;AAED,eAAO,MAAM,uBAAuB,EAAE,SAAS,SAAS,EAMvD,CAAC"}
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { BaseNode, prop } from "@nodetool-ai/node-sdk";
|
|
8
|
+
import { cleanParams, getHfToken, hfPipelineBinary, hfPipelineJson, imageRefFromBase64, imageRefFromBytes, jsonArray, jsonNumber, jsonObject, jsonString, refToBase64 } from "../huggingface-base.js";
|
|
9
|
+
const EMPTY_IMAGE = {
|
|
10
|
+
type: "image",
|
|
11
|
+
uri: "",
|
|
12
|
+
asset_id: null,
|
|
13
|
+
data: null,
|
|
14
|
+
metadata: null
|
|
15
|
+
};
|
|
16
|
+
export class TextToImageNode extends BaseNode {
|
|
17
|
+
static nodeType = "huggingface.TextToImage";
|
|
18
|
+
static body = "content_card";
|
|
19
|
+
static title = "Text to Image";
|
|
20
|
+
static description = "Generate an image from a text prompt via Hugging Face Inference Providers.\n" +
|
|
21
|
+
"image, text-to-image, t2i, generation, diffusion, huggingface\n\n" +
|
|
22
|
+
"Use cases:\n" +
|
|
23
|
+
"- Create artwork from a description\n" +
|
|
24
|
+
"- Generate product or concept images\n" +
|
|
25
|
+
"- Prototype visual ideas";
|
|
26
|
+
static inlineFields = ["prompt"];
|
|
27
|
+
static requiredSettings = ["HF_TOKEN"];
|
|
28
|
+
static autoSaveAsset = true;
|
|
29
|
+
static metadataOutputTypes = { output: "image" };
|
|
30
|
+
async process() {
|
|
31
|
+
const token = getHfToken(this._secrets);
|
|
32
|
+
const prompt = String(this.prompt ?? "");
|
|
33
|
+
if (!prompt)
|
|
34
|
+
throw new Error("Prompt cannot be empty");
|
|
35
|
+
const width = Number(this.width ?? 0);
|
|
36
|
+
const height = Number(this.height ?? 0);
|
|
37
|
+
const guidance = Number(this.guidance_scale ?? 0);
|
|
38
|
+
const steps = Number(this.num_inference_steps ?? 0);
|
|
39
|
+
const seed = Number(this.seed ?? -1);
|
|
40
|
+
const { bytes, mimeType } = await hfPipelineBinary(token, String(this.model ?? "black-forest-labs/FLUX.1-schnell"), {
|
|
41
|
+
inputs: prompt,
|
|
42
|
+
parameters: cleanParams({
|
|
43
|
+
negative_prompt: String(this.negative_prompt ?? "") || undefined,
|
|
44
|
+
width: width > 0 ? width : undefined,
|
|
45
|
+
height: height > 0 ? height : undefined,
|
|
46
|
+
guidance_scale: guidance > 0 ? guidance : undefined,
|
|
47
|
+
num_inference_steps: steps > 0 ? steps : undefined,
|
|
48
|
+
seed: seed >= 0 ? seed : undefined
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
output: imageRefFromBytes(bytes, mimeType.startsWith("image/") ? mimeType : "image/png")
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
__decorate([
|
|
57
|
+
prop({
|
|
58
|
+
type: "str",
|
|
59
|
+
default: "black-forest-labs/FLUX.1-schnell",
|
|
60
|
+
title: "Model",
|
|
61
|
+
description: "Text-to-image model repo id (e.g. black-forest-labs/FLUX.1-schnell, stabilityai/stable-diffusion-xl-base-1.0)."
|
|
62
|
+
})
|
|
63
|
+
], TextToImageNode.prototype, "model", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
prop({
|
|
66
|
+
type: "str",
|
|
67
|
+
default: "",
|
|
68
|
+
title: "Prompt",
|
|
69
|
+
description: "The text prompt describing the image."
|
|
70
|
+
})
|
|
71
|
+
], TextToImageNode.prototype, "prompt", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
prop({
|
|
74
|
+
type: "str",
|
|
75
|
+
default: "",
|
|
76
|
+
title: "Negative Prompt",
|
|
77
|
+
description: "What the image should NOT contain."
|
|
78
|
+
})
|
|
79
|
+
], TextToImageNode.prototype, "negative_prompt", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
prop({
|
|
82
|
+
type: "int",
|
|
83
|
+
default: 0,
|
|
84
|
+
title: "Width",
|
|
85
|
+
description: "Output width in pixels (0 = model default).",
|
|
86
|
+
min: 0,
|
|
87
|
+
max: 2048
|
|
88
|
+
})
|
|
89
|
+
], TextToImageNode.prototype, "width", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
prop({
|
|
92
|
+
type: "int",
|
|
93
|
+
default: 0,
|
|
94
|
+
title: "Height",
|
|
95
|
+
description: "Output height in pixels (0 = model default).",
|
|
96
|
+
min: 0,
|
|
97
|
+
max: 2048
|
|
98
|
+
})
|
|
99
|
+
], TextToImageNode.prototype, "height", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
prop({
|
|
102
|
+
type: "float",
|
|
103
|
+
default: 0,
|
|
104
|
+
title: "Guidance Scale",
|
|
105
|
+
description: "How closely to follow the prompt (0 = model default).",
|
|
106
|
+
min: 0,
|
|
107
|
+
max: 30
|
|
108
|
+
})
|
|
109
|
+
], TextToImageNode.prototype, "guidance_scale", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
prop({
|
|
112
|
+
type: "int",
|
|
113
|
+
default: 0,
|
|
114
|
+
title: "Inference Steps",
|
|
115
|
+
description: "Number of denoising steps (0 = model default).",
|
|
116
|
+
min: 0,
|
|
117
|
+
max: 100
|
|
118
|
+
})
|
|
119
|
+
], TextToImageNode.prototype, "num_inference_steps", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
prop({
|
|
122
|
+
type: "int",
|
|
123
|
+
default: -1,
|
|
124
|
+
title: "Seed",
|
|
125
|
+
description: "Random seed (-1 = random).",
|
|
126
|
+
min: -1,
|
|
127
|
+
max: 4294967295
|
|
128
|
+
})
|
|
129
|
+
], TextToImageNode.prototype, "seed", void 0);
|
|
130
|
+
export class ImageToImageNode extends BaseNode {
|
|
131
|
+
static nodeType = "huggingface.ImageToImage";
|
|
132
|
+
static body = "content_card";
|
|
133
|
+
static title = "Image to Image";
|
|
134
|
+
static description = "Transform a source image guided by a prompt (edit, restyle, upscale).\n" +
|
|
135
|
+
"image, image-to-image, edit, transform, diffusion, huggingface\n\n" +
|
|
136
|
+
"Use cases:\n" +
|
|
137
|
+
"- Edit or restyle an image\n" +
|
|
138
|
+
"- Colorize or enhance photos\n" +
|
|
139
|
+
"- Apply a target style";
|
|
140
|
+
static inlineFields = ["prompt"];
|
|
141
|
+
static inputFields = ["image"];
|
|
142
|
+
static requiredSettings = ["HF_TOKEN"];
|
|
143
|
+
static autoSaveAsset = true;
|
|
144
|
+
static metadataOutputTypes = { output: "image" };
|
|
145
|
+
async process(context) {
|
|
146
|
+
const token = getHfToken(this._secrets);
|
|
147
|
+
const image = this.image;
|
|
148
|
+
if (!image || (!image.uri && !image.data)) {
|
|
149
|
+
throw new Error("Input image is required");
|
|
150
|
+
}
|
|
151
|
+
const base64 = await refToBase64(image, context);
|
|
152
|
+
const guidance = Number(this.guidance_scale ?? 0);
|
|
153
|
+
const steps = Number(this.num_inference_steps ?? 0);
|
|
154
|
+
const { bytes, mimeType } = await hfPipelineBinary(token, String(this.model ?? "black-forest-labs/FLUX.1-Kontext-dev"), {
|
|
155
|
+
inputs: base64,
|
|
156
|
+
parameters: cleanParams({
|
|
157
|
+
prompt: String(this.prompt ?? "") || undefined,
|
|
158
|
+
negative_prompt: String(this.negative_prompt ?? "") || undefined,
|
|
159
|
+
guidance_scale: guidance > 0 ? guidance : undefined,
|
|
160
|
+
num_inference_steps: steps > 0 ? steps : undefined
|
|
161
|
+
})
|
|
162
|
+
});
|
|
163
|
+
return {
|
|
164
|
+
output: imageRefFromBytes(bytes, mimeType.startsWith("image/") ? mimeType : "image/png")
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
__decorate([
|
|
169
|
+
prop({
|
|
170
|
+
type: "str",
|
|
171
|
+
default: "black-forest-labs/FLUX.1-Kontext-dev",
|
|
172
|
+
title: "Model",
|
|
173
|
+
description: "Image-to-image model repo id."
|
|
174
|
+
})
|
|
175
|
+
], ImageToImageNode.prototype, "model", void 0);
|
|
176
|
+
__decorate([
|
|
177
|
+
prop({
|
|
178
|
+
type: "image",
|
|
179
|
+
default: EMPTY_IMAGE,
|
|
180
|
+
title: "Image",
|
|
181
|
+
description: "The source image to transform."
|
|
182
|
+
})
|
|
183
|
+
], ImageToImageNode.prototype, "image", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
prop({
|
|
186
|
+
type: "str",
|
|
187
|
+
default: "",
|
|
188
|
+
title: "Prompt",
|
|
189
|
+
description: "Text prompt guiding the transformation."
|
|
190
|
+
})
|
|
191
|
+
], ImageToImageNode.prototype, "prompt", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
prop({
|
|
194
|
+
type: "str",
|
|
195
|
+
default: "",
|
|
196
|
+
title: "Negative Prompt",
|
|
197
|
+
description: "What the result should NOT contain."
|
|
198
|
+
})
|
|
199
|
+
], ImageToImageNode.prototype, "negative_prompt", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
prop({
|
|
202
|
+
type: "float",
|
|
203
|
+
default: 0,
|
|
204
|
+
title: "Guidance Scale",
|
|
205
|
+
description: "How closely to follow the prompt (0 = model default).",
|
|
206
|
+
min: 0,
|
|
207
|
+
max: 30
|
|
208
|
+
})
|
|
209
|
+
], ImageToImageNode.prototype, "guidance_scale", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
prop({
|
|
212
|
+
type: "int",
|
|
213
|
+
default: 0,
|
|
214
|
+
title: "Inference Steps",
|
|
215
|
+
description: "Number of denoising steps (0 = model default).",
|
|
216
|
+
min: 0,
|
|
217
|
+
max: 100
|
|
218
|
+
})
|
|
219
|
+
], ImageToImageNode.prototype, "num_inference_steps", void 0);
|
|
220
|
+
export class ImageClassificationNode extends BaseNode {
|
|
221
|
+
static nodeType = "huggingface.ImageClassification";
|
|
222
|
+
static title = "Image Classification";
|
|
223
|
+
static description = "Assign a label / class to an image.\n" +
|
|
224
|
+
"image, classification, vision, label, huggingface\n\n" +
|
|
225
|
+
"Use cases:\n" +
|
|
226
|
+
"- Categorize images\n" +
|
|
227
|
+
"- Content moderation (e.g. NSFW detection)\n" +
|
|
228
|
+
"- Quality / defect tagging";
|
|
229
|
+
static inputFields = ["image"];
|
|
230
|
+
static requiredSettings = ["HF_TOKEN"];
|
|
231
|
+
static metadataOutputTypes = { output: "str", scores: "list" };
|
|
232
|
+
async process(context) {
|
|
233
|
+
const token = getHfToken(this._secrets);
|
|
234
|
+
const image = this.image;
|
|
235
|
+
if (!image || (!image.uri && !image.data)) {
|
|
236
|
+
throw new Error("Input image is required");
|
|
237
|
+
}
|
|
238
|
+
const base64 = await refToBase64(image, context);
|
|
239
|
+
const result = await hfPipelineJson(token, String(this.model ?? "google/vit-base-patch16-224"), {
|
|
240
|
+
inputs: base64,
|
|
241
|
+
parameters: { top_k: Number(this.top_k ?? 5) }
|
|
242
|
+
});
|
|
243
|
+
const scores = jsonArray(result);
|
|
244
|
+
return { output: jsonString(jsonObject(scores[0])["label"]), scores };
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
__decorate([
|
|
248
|
+
prop({
|
|
249
|
+
type: "str",
|
|
250
|
+
default: "google/vit-base-patch16-224",
|
|
251
|
+
title: "Model",
|
|
252
|
+
description: "Image-classification model repo id."
|
|
253
|
+
})
|
|
254
|
+
], ImageClassificationNode.prototype, "model", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
prop({
|
|
257
|
+
type: "image",
|
|
258
|
+
default: EMPTY_IMAGE,
|
|
259
|
+
title: "Image",
|
|
260
|
+
description: "The image to classify."
|
|
261
|
+
})
|
|
262
|
+
], ImageClassificationNode.prototype, "image", void 0);
|
|
263
|
+
__decorate([
|
|
264
|
+
prop({
|
|
265
|
+
type: "int",
|
|
266
|
+
default: 5,
|
|
267
|
+
title: "Top K",
|
|
268
|
+
description: "Return the top K most probable classes.",
|
|
269
|
+
min: 1,
|
|
270
|
+
max: 100
|
|
271
|
+
})
|
|
272
|
+
], ImageClassificationNode.prototype, "top_k", void 0);
|
|
273
|
+
export class ImageSegmentationNode extends BaseNode {
|
|
274
|
+
static nodeType = "huggingface.ImageSegmentation";
|
|
275
|
+
static title = "Image Segmentation";
|
|
276
|
+
static description = "Segment an image into labeled regions, each with a mask.\n" +
|
|
277
|
+
"image, segmentation, vision, mask, huggingface\n\n" +
|
|
278
|
+
"Use cases:\n" +
|
|
279
|
+
"- Isolate objects from a scene\n" +
|
|
280
|
+
"- Build selection masks\n" +
|
|
281
|
+
"- Scene understanding";
|
|
282
|
+
static inputFields = ["image"];
|
|
283
|
+
static requiredSettings = ["HF_TOKEN"];
|
|
284
|
+
static metadataOutputTypes = { output: "list" };
|
|
285
|
+
async process(context) {
|
|
286
|
+
const token = getHfToken(this._secrets);
|
|
287
|
+
const image = this.image;
|
|
288
|
+
if (!image || (!image.uri && !image.data)) {
|
|
289
|
+
throw new Error("Input image is required");
|
|
290
|
+
}
|
|
291
|
+
const base64 = await refToBase64(image, context);
|
|
292
|
+
const result = await hfPipelineJson(token, String(this.model ?? "nvidia/segformer-b0-finetuned-ade-512-512"), { inputs: base64 });
|
|
293
|
+
// Each segment's mask comes back as a base64 PNG — expose it as an image ref.
|
|
294
|
+
const segments = jsonArray(result).map((entry) => {
|
|
295
|
+
const seg = jsonObject(entry);
|
|
296
|
+
const score = seg["score"];
|
|
297
|
+
const mask = jsonString(seg["mask"]);
|
|
298
|
+
return {
|
|
299
|
+
label: jsonString(seg["label"]),
|
|
300
|
+
score: score != null ? jsonNumber(score) : null,
|
|
301
|
+
mask: mask ? imageRefFromBase64(mask) : null
|
|
302
|
+
};
|
|
303
|
+
});
|
|
304
|
+
return { output: segments };
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
__decorate([
|
|
308
|
+
prop({
|
|
309
|
+
type: "str",
|
|
310
|
+
default: "nvidia/segformer-b0-finetuned-ade-512-512",
|
|
311
|
+
title: "Model",
|
|
312
|
+
description: "Image-segmentation model repo id."
|
|
313
|
+
})
|
|
314
|
+
], ImageSegmentationNode.prototype, "model", void 0);
|
|
315
|
+
__decorate([
|
|
316
|
+
prop({
|
|
317
|
+
type: "image",
|
|
318
|
+
default: EMPTY_IMAGE,
|
|
319
|
+
title: "Image",
|
|
320
|
+
description: "The image to segment."
|
|
321
|
+
})
|
|
322
|
+
], ImageSegmentationNode.prototype, "image", void 0);
|
|
323
|
+
export class ObjectDetectionNode extends BaseNode {
|
|
324
|
+
static nodeType = "huggingface.ObjectDetection";
|
|
325
|
+
static title = "Object Detection";
|
|
326
|
+
static description = "Detect objects in an image, returning labels, scores and bounding boxes.\n" +
|
|
327
|
+
"image, object-detection, vision, bounding-box, huggingface\n\n" +
|
|
328
|
+
"Use cases:\n" +
|
|
329
|
+
"- Locate objects in a scene\n" +
|
|
330
|
+
"- Count items in an image\n" +
|
|
331
|
+
"- Build vision pipelines";
|
|
332
|
+
static inputFields = ["image"];
|
|
333
|
+
static requiredSettings = ["HF_TOKEN"];
|
|
334
|
+
static metadataOutputTypes = { output: "list" };
|
|
335
|
+
async process(context) {
|
|
336
|
+
const token = getHfToken(this._secrets);
|
|
337
|
+
const image = this.image;
|
|
338
|
+
if (!image || (!image.uri && !image.data)) {
|
|
339
|
+
throw new Error("Input image is required");
|
|
340
|
+
}
|
|
341
|
+
const base64 = await refToBase64(image, context);
|
|
342
|
+
const result = await hfPipelineJson(token, String(this.model ?? "facebook/detr-resnet-50"), {
|
|
343
|
+
inputs: base64,
|
|
344
|
+
parameters: { threshold: Number(this.threshold ?? 0.5) }
|
|
345
|
+
});
|
|
346
|
+
return { output: jsonArray(result) };
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
__decorate([
|
|
350
|
+
prop({
|
|
351
|
+
type: "str",
|
|
352
|
+
default: "facebook/detr-resnet-50",
|
|
353
|
+
title: "Model",
|
|
354
|
+
description: "Object-detection model repo id."
|
|
355
|
+
})
|
|
356
|
+
], ObjectDetectionNode.prototype, "model", void 0);
|
|
357
|
+
__decorate([
|
|
358
|
+
prop({
|
|
359
|
+
type: "image",
|
|
360
|
+
default: EMPTY_IMAGE,
|
|
361
|
+
title: "Image",
|
|
362
|
+
description: "The image to analyze."
|
|
363
|
+
})
|
|
364
|
+
], ObjectDetectionNode.prototype, "image", void 0);
|
|
365
|
+
__decorate([
|
|
366
|
+
prop({
|
|
367
|
+
type: "float",
|
|
368
|
+
default: 0.5,
|
|
369
|
+
title: "Threshold",
|
|
370
|
+
description: "Minimum confidence for a detection to be returned.",
|
|
371
|
+
min: 0,
|
|
372
|
+
max: 1
|
|
373
|
+
})
|
|
374
|
+
], ObjectDetectionNode.prototype, "threshold", void 0);
|
|
375
|
+
export const HUGGINGFACE_IMAGE_NODES = [
|
|
376
|
+
TextToImageNode,
|
|
377
|
+
ImageToImageNode,
|
|
378
|
+
ImageClassificationNode,
|
|
379
|
+
ImageSegmentationNode,
|
|
380
|
+
ObjectDetectionNode
|
|
381
|
+
];
|
|
382
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../src/nodes/image.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EAGZ,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,OAAO;IACb,GAAG,EAAE,EAAE;IACP,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,IAAI;CACf,CAAC;AAOF,MAAM,OAAO,eAAgB,SAAQ,QAAQ;IAC3C,MAAM,CAAU,QAAQ,GAAG,yBAAyB,CAAC;IACrD,MAAM,CAAU,IAAI,GAAG,cAAc,CAAC;IACtC,MAAM,CAAU,KAAK,GAAG,eAAe,CAAC;IACxC,MAAM,CAAU,WAAW,GACzB,8EAA8E;QAC9E,mEAAmE;QACnE,cAAc;QACd,uCAAuC;QACvC,wCAAwC;QACxC,0BAA0B,CAAC;IAC7B,MAAM,CAAU,YAAY,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,CAAU,gBAAgB,GAAG,CAAC,UAAU,CAAC,CAAC;IAChD,MAAM,CAAU,aAAa,GAAG,IAAI,CAAC;IACrC,MAAM,CAAU,mBA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