Create together.yaml
Browse files- together.yaml +63 -0
together.yaml
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
_id: together_ai
|
| 2 |
+
title: Together AI
|
| 3 |
+
description: ""
|
| 4 |
+
version: 1
|
| 5 |
+
readme: ""
|
| 6 |
+
author: Anton Breslavskii | https://github.com/breslavsky
|
| 7 |
+
url: https://huggingface.co/PiperMy/Node-Packages/resolve/main/together-ai.yaml
|
| 8 |
+
nodes:
|
| 9 |
+
generate_flux_together_ai:
|
| 10 |
+
_id: generate_flux_together_ai
|
| 11 |
+
arrange:
|
| 12 |
+
x: 130
|
| 13 |
+
y: 110
|
| 14 |
+
category:
|
| 15 |
+
id: generate_images
|
| 16 |
+
title: en=Generate images;ru=Генерация изображений
|
| 17 |
+
environment:
|
| 18 |
+
TOGETHER_API_KEY:
|
| 19 |
+
title: Together API key
|
| 20 |
+
type: string
|
| 21 |
+
scope: global
|
| 22 |
+
inputs:
|
| 23 |
+
prompt:
|
| 24 |
+
order: 1
|
| 25 |
+
title: Prompt
|
| 26 |
+
type: string
|
| 27 |
+
required: true
|
| 28 |
+
multiline: true
|
| 29 |
+
default: cat at a moon
|
| 30 |
+
outputs:
|
| 31 |
+
image:
|
| 32 |
+
title: Image
|
| 33 |
+
type: image
|
| 34 |
+
package: together_ai
|
| 35 |
+
script: |-
|
| 36 |
+
export async function run({ inputs }) {
|
| 37 |
+
|
| 38 |
+
const { FatalError, NextNode } = DEFINITIONS;
|
| 39 |
+
const { prompt } = inputs;
|
| 40 |
+
|
| 41 |
+
const TOGETHER_API_KEY = env?.variables?.get('TOGETHER_API_KEY');
|
| 42 |
+
if (!TOGETHER_API_KEY) {
|
| 43 |
+
throw new FatalError('Please, set your API key for Together AI');
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
const Together = require('together-ai');
|
| 47 |
+
const together = new Together({ apiKey: TOGETHER_API_KEY });
|
| 48 |
+
|
| 49 |
+
const { data } = await together.images.create({
|
| 50 |
+
model: "black-forest-labs/FLUX.1-schnell-Free",
|
| 51 |
+
prompt,
|
| 52 |
+
width: 1024,
|
| 53 |
+
height: 1024,
|
| 54 |
+
steps: 4,
|
| 55 |
+
n: 1
|
| 56 |
+
});
|
| 57 |
+
const [{ url }] = data;
|
| 58 |
+
return NextNode.from({ outputs: { image: url } });
|
| 59 |
+
|
| 60 |
+
}
|
| 61 |
+
source: catalog
|
| 62 |
+
title: en=Generate Flux Free;ru=Генерация Flux бесплатно
|
| 63 |
+
version: 1
|