Update gpt4free.yaml
Browse files- gpt4free.yaml +7 -6
gpt4free.yaml
CHANGED
|
@@ -39,15 +39,16 @@ nodes:
|
|
| 39 |
type: string
|
| 40 |
package: gpt4free
|
| 41 |
script: |
|
| 42 |
-
|
| 43 |
-
|
|
|
|
| 44 |
const { prompt, model } = inputs;
|
| 45 |
|
| 46 |
-
const {data: {provider, data: [{ b64_json }]}} = await httpClient({
|
| 47 |
method: 'post',
|
| 48 |
url: `http://${NODE_ENV === 'test' ? '0.0.0.0' : 'gpt4free'}:1337/v1/images/generate`,
|
| 49 |
timeout: 20000,
|
| 50 |
-
data: {
|
| 51 |
prompt,
|
| 52 |
model: model || 'flux',
|
| 53 |
response_format: 'b64_json'
|
|
@@ -56,8 +57,8 @@ nodes:
|
|
| 56 |
'Content-Type': 'application/json',
|
| 57 |
}
|
| 58 |
});
|
| 59 |
-
return
|
| 60 |
-
}
|
| 61 |
source: catalog
|
| 62 |
title: en=Generate image for free;ru=Генерация изображения бесплатно
|
| 63 |
version: 5
|
|
|
|
| 39 |
type: string
|
| 40 |
package: gpt4free
|
| 41 |
script: |
|
| 42 |
+
export async function run({ inputs }) {
|
| 43 |
+
|
| 44 |
+
const { NextNode } = DEFINITIONS;
|
| 45 |
const { prompt, model } = inputs;
|
| 46 |
|
| 47 |
+
const { data: { provider, data: [{ b64_json }] } } = await httpClient({
|
| 48 |
method: 'post',
|
| 49 |
url: `http://${NODE_ENV === 'test' ? '0.0.0.0' : 'gpt4free'}:1337/v1/images/generate`,
|
| 50 |
timeout: 20000,
|
| 51 |
+
data: {
|
| 52 |
prompt,
|
| 53 |
model: model || 'flux',
|
| 54 |
response_format: 'b64_json'
|
|
|
|
| 57 |
'Content-Type': 'application/json',
|
| 58 |
}
|
| 59 |
});
|
| 60 |
+
return NextNode.from({ outputs: { image: Buffer.from(b64_json, 'base64'), provider } });
|
| 61 |
+
}
|
| 62 |
source: catalog
|
| 63 |
title: en=Generate image for free;ru=Генерация изображения бесплатно
|
| 64 |
version: 5
|