Update artworks.yaml
Browse files- artworks.yaml +521 -15
artworks.yaml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
_id: artworks
|
| 2 |
description: Image generation, mask extraction, etc.
|
| 3 |
-
readme:
|
| 4 |
title: en=ArtWorks AI;ru=Узлы ArtWorks AI
|
| 5 |
url: https://huggingface.co/PiperMy/Node-Packages/resolve/main/artworks.yaml
|
| 6 |
-
version:
|
| 7 |
nodes:
|
| 8 |
image_to_image_artworks:
|
| 9 |
_id: image_to_image_artworks
|
|
@@ -350,12 +350,15 @@ nodes:
|
|
| 350 |
groups:
|
| 351 |
inputs:
|
| 352 |
SDXL:
|
| 353 |
-
order:
|
| 354 |
title: SDXL checkpoints
|
| 355 |
description: Only for SDXL checkpoints
|
| 356 |
base:
|
| 357 |
order: 1
|
| 358 |
title: en=Base parameters;ru=Базовые параметры
|
|
|
|
|
|
|
|
|
|
| 359 |
inputs:
|
| 360 |
checkpoint:
|
| 361 |
order: 2
|
|
@@ -488,6 +491,13 @@ nodes:
|
|
| 488 |
group: base
|
| 489 |
type: integer
|
| 490 |
placeholder: "-1"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 491 |
outputs:
|
| 492 |
images:
|
| 493 |
title: en=Images;ru=Изображения
|
|
@@ -560,9 +570,7 @@ nodes:
|
|
| 560 |
checkpoint,
|
| 561 |
cfgScale,
|
| 562 |
size,
|
| 563 |
-
|
| 564 |
-
performance
|
| 565 |
-
} : {}),
|
| 566 |
...(seed > 0 ? {
|
| 567 |
seed
|
| 568 |
} : {}),
|
|
@@ -1714,13 +1722,23 @@ nodes:
|
|
| 1714 |
type: image
|
| 1715 |
required: true
|
| 1716 |
labels:
|
| 1717 |
-
order:
|
| 1718 |
title: en=Labels;ru=Теги
|
| 1719 |
type: json
|
| 1720 |
required: true
|
| 1721 |
default: '{ "girl": "girl on photo", "male": "male on photo" }'
|
| 1722 |
schema:
|
| 1723 |
id: image-labels
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1724 |
outputs:
|
| 1725 |
labels:
|
| 1726 |
title: en=Labels;ru=Теги
|
|
@@ -1755,7 +1773,7 @@ nodes:
|
|
| 1755 |
});
|
| 1756 |
|
| 1757 |
if (!state) {
|
| 1758 |
-
const { image, labels } = inputs;
|
| 1759 |
|
| 1760 |
const payload = {
|
| 1761 |
type: "classify-image",
|
|
@@ -1763,6 +1781,7 @@ nodes:
|
|
| 1763 |
payload: {
|
| 1764 |
base64: false,
|
| 1765 |
image,
|
|
|
|
| 1766 |
labels: Object.values(labels),
|
| 1767 |
},
|
| 1768 |
};
|
|
@@ -2382,15 +2401,15 @@ nodes:
|
|
| 2382 |
OPEN_PAAS_USER:
|
| 2383 |
title: PaaS user
|
| 2384 |
type: string
|
| 2385 |
-
scope:
|
| 2386 |
OPEN_PAAS_PASSWORD:
|
| 2387 |
title: PaaS password
|
| 2388 |
type: string
|
| 2389 |
-
scope:
|
| 2390 |
PAAS_BASE_URL:
|
| 2391 |
title: PaaS base url
|
| 2392 |
type: string
|
| 2393 |
-
scope:
|
| 2394 |
execution: regular
|
| 2395 |
groups:
|
| 2396 |
inputs:
|
|
@@ -2434,8 +2453,6 @@ nodes:
|
|
| 2434 |
- mixGEMAdam8witQegoow.NeWz.safetensors|MyMIX-G/Jem <SDXL> <Realistic>
|
| 2435 |
- mfcgPDXL_v10.safetensors|MFCG PDXL <SDXL>
|
| 2436 |
- aniku_0.2.fp16.safetensors|Anime Desire <SDXL> <Fantasy>
|
| 2437 |
-
- flux1DevHyperNF4Flux1DevBNB_flux1DevHyperNF4.safetensors|Hyper NF4 Flux 1 <Flux>
|
| 2438 |
-
- STOIQONewrealityFLUXSD_F1DPreAlpha.safetensors|New Reality Flux <Flux>
|
| 2439 |
- juggernautXL_v9Rundiffusionphoto2.safetensors|Juggernaut XL <SDXL>
|
| 2440 |
- animaPencilXL_v260.safetensors|Anima Pencil XL <SDXL> <Fantasy>
|
| 2441 |
- bluePencilXL_v401.safetensors|Blue Pencil XL <SDXL> <Fantasy>
|
|
@@ -2443,9 +2460,7 @@ nodes:
|
|
| 2443 |
- albedobaseXL_v20.safetensors|AlbedoBase XL <SDXL>
|
| 2444 |
- leosamsHelloworldXL_helloworldXL50GPT4V.safetensors|Helloworld XL <SDXL>
|
| 2445 |
- dynavisionXLAllInOneStylized_releaseV0610Bakedvae.safetensors|DynaVision XL All In One <SDXL>
|
| 2446 |
-
- photon_v1.safetensors|Photon <SD 1.5>
|
| 2447 |
- afroditexlNudePeople_20Bkdvae.safetensors|Nude People <NSFW>
|
| 2448 |
-
- nosft-float8-e4m3fn.safetensors|Flux Nude People <NSFW>
|
| 2449 |
- asdf_0.4a_lorapov_0.2_lust_0.4.fp16.safetensors|Real Porn <NSFW>
|
| 2450 |
- Sexy_Aesthetic_SDXL_0.4x0.2.fp16.safetensors|Sexy & Beauty <NSFW>
|
| 2451 |
- aniku_0.2.fp16.safetensors|Anime Desire <NSFW>
|
|
@@ -3330,3 +3345,494 @@ nodes:
|
|
| 3330 |
source: catalog
|
| 3331 |
title: en=Score aesthetics;ru=Оценить эстестику
|
| 3332 |
version: 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
_id: artworks
|
| 2 |
description: Image generation, mask extraction, etc.
|
| 3 |
+
readme: Added PuLID
|
| 4 |
title: en=ArtWorks AI;ru=Узлы ArtWorks AI
|
| 5 |
url: https://huggingface.co/PiperMy/Node-Packages/resolve/main/artworks.yaml
|
| 6 |
+
version: 6
|
| 7 |
nodes:
|
| 8 |
image_to_image_artworks:
|
| 9 |
_id: image_to_image_artworks
|
|
|
|
| 350 |
groups:
|
| 351 |
inputs:
|
| 352 |
SDXL:
|
| 353 |
+
order: 3
|
| 354 |
title: SDXL checkpoints
|
| 355 |
description: Only for SDXL checkpoints
|
| 356 |
base:
|
| 357 |
order: 1
|
| 358 |
title: en=Base parameters;ru=Базовые параметры
|
| 359 |
+
special:
|
| 360 |
+
order: 2
|
| 361 |
+
title: en=Special;ru=Специальные возможности
|
| 362 |
inputs:
|
| 363 |
checkpoint:
|
| 364 |
order: 2
|
|
|
|
| 491 |
group: base
|
| 492 |
type: integer
|
| 493 |
placeholder: "-1"
|
| 494 |
+
controlNets:
|
| 495 |
+
order: 1
|
| 496 |
+
title: en=Control nets;ru=Контрольные сети
|
| 497 |
+
group: special
|
| 498 |
+
type: json
|
| 499 |
+
schema:
|
| 500 |
+
id: control-nets
|
| 501 |
outputs:
|
| 502 |
images:
|
| 503 |
title: en=Images;ru=Изображения
|
|
|
|
| 570 |
checkpoint,
|
| 571 |
cfgScale,
|
| 572 |
size,
|
| 573 |
+
performance: performance || "express",
|
|
|
|
|
|
|
| 574 |
...(seed > 0 ? {
|
| 575 |
seed
|
| 576 |
} : {}),
|
|
|
|
| 1722 |
type: image
|
| 1723 |
required: true
|
| 1724 |
labels:
|
| 1725 |
+
order: 3
|
| 1726 |
title: en=Labels;ru=Теги
|
| 1727 |
type: json
|
| 1728 |
required: true
|
| 1729 |
default: '{ "girl": "girl on photo", "male": "male on photo" }'
|
| 1730 |
schema:
|
| 1731 |
id: image-labels
|
| 1732 |
+
model:
|
| 1733 |
+
order: 2
|
| 1734 |
+
title: en=Model;ru=Модель
|
| 1735 |
+
type: string
|
| 1736 |
+
required: true
|
| 1737 |
+
default: clip
|
| 1738 |
+
enum:
|
| 1739 |
+
- clip
|
| 1740 |
+
- siglip-1
|
| 1741 |
+
- siglip-2
|
| 1742 |
outputs:
|
| 1743 |
labels:
|
| 1744 |
title: en=Labels;ru=Теги
|
|
|
|
| 1773 |
});
|
| 1774 |
|
| 1775 |
if (!state) {
|
| 1776 |
+
const { image, model, labels } = inputs;
|
| 1777 |
|
| 1778 |
const payload = {
|
| 1779 |
type: "classify-image",
|
|
|
|
| 1781 |
payload: {
|
| 1782 |
base64: false,
|
| 1783 |
image,
|
| 1784 |
+
model,
|
| 1785 |
labels: Object.values(labels),
|
| 1786 |
},
|
| 1787 |
};
|
|
|
|
| 2401 |
OPEN_PAAS_USER:
|
| 2402 |
title: PaaS user
|
| 2403 |
type: string
|
| 2404 |
+
scope: user
|
| 2405 |
OPEN_PAAS_PASSWORD:
|
| 2406 |
title: PaaS password
|
| 2407 |
type: string
|
| 2408 |
+
scope: user
|
| 2409 |
PAAS_BASE_URL:
|
| 2410 |
title: PaaS base url
|
| 2411 |
type: string
|
| 2412 |
+
scope: user
|
| 2413 |
execution: regular
|
| 2414 |
groups:
|
| 2415 |
inputs:
|
|
|
|
| 2453 |
- mixGEMAdam8witQegoow.NeWz.safetensors|MyMIX-G/Jem <SDXL> <Realistic>
|
| 2454 |
- mfcgPDXL_v10.safetensors|MFCG PDXL <SDXL>
|
| 2455 |
- aniku_0.2.fp16.safetensors|Anime Desire <SDXL> <Fantasy>
|
|
|
|
|
|
|
| 2456 |
- juggernautXL_v9Rundiffusionphoto2.safetensors|Juggernaut XL <SDXL>
|
| 2457 |
- animaPencilXL_v260.safetensors|Anima Pencil XL <SDXL> <Fantasy>
|
| 2458 |
- bluePencilXL_v401.safetensors|Blue Pencil XL <SDXL> <Fantasy>
|
|
|
|
| 2460 |
- albedobaseXL_v20.safetensors|AlbedoBase XL <SDXL>
|
| 2461 |
- leosamsHelloworldXL_helloworldXL50GPT4V.safetensors|Helloworld XL <SDXL>
|
| 2462 |
- dynavisionXLAllInOneStylized_releaseV0610Bakedvae.safetensors|DynaVision XL All In One <SDXL>
|
|
|
|
| 2463 |
- afroditexlNudePeople_20Bkdvae.safetensors|Nude People <NSFW>
|
|
|
|
| 2464 |
- asdf_0.4a_lorapov_0.2_lust_0.4.fp16.safetensors|Real Porn <NSFW>
|
| 2465 |
- Sexy_Aesthetic_SDXL_0.4x0.2.fp16.safetensors|Sexy & Beauty <NSFW>
|
| 2466 |
- aniku_0.2.fp16.safetensors|Anime Desire <NSFW>
|
|
|
|
| 3345 |
source: catalog
|
| 3346 |
title: en=Score aesthetics;ru=Оценить эстестику
|
| 3347 |
version: 1
|
| 3348 |
+
dress_on_image:
|
| 3349 |
+
_id: dress_on_image
|
| 3350 |
+
arrange:
|
| 3351 |
+
x: 210
|
| 3352 |
+
y: 1100
|
| 3353 |
+
category:
|
| 3354 |
+
_id: deep_swap
|
| 3355 |
+
title: en=Deep swap;ru=Глубокая замена
|
| 3356 |
+
environment:
|
| 3357 |
+
OPEN_PAAS_USER:
|
| 3358 |
+
title: PaaS user
|
| 3359 |
+
type: string
|
| 3360 |
+
scope: global
|
| 3361 |
+
OPEN_PAAS_PASSWORD:
|
| 3362 |
+
title: PaaS password
|
| 3363 |
+
type: string
|
| 3364 |
+
scope: global
|
| 3365 |
+
PAAS_BASE_URL:
|
| 3366 |
+
title: PaaS base url
|
| 3367 |
+
type: string
|
| 3368 |
+
scope: global
|
| 3369 |
+
execution: regular
|
| 3370 |
+
inputs:
|
| 3371 |
+
image:
|
| 3372 |
+
order: 1
|
| 3373 |
+
title: en=Image;ru=Изображение
|
| 3374 |
+
type: image
|
| 3375 |
+
required: true
|
| 3376 |
+
prompt:
|
| 3377 |
+
order: 3
|
| 3378 |
+
title: en=Prompt;ru=Подсказка
|
| 3379 |
+
type: string
|
| 3380 |
+
required: true
|
| 3381 |
+
multiline: true
|
| 3382 |
+
default: RAW photo, red swimsuit
|
| 3383 |
+
gender:
|
| 3384 |
+
order: 2
|
| 3385 |
+
title: en=Gender;ru=Пол
|
| 3386 |
+
type: string
|
| 3387 |
+
default: auto
|
| 3388 |
+
enum:
|
| 3389 |
+
- auto
|
| 3390 |
+
- male
|
| 3391 |
+
- female
|
| 3392 |
+
outputs:
|
| 3393 |
+
image:
|
| 3394 |
+
title: en=Image;ru=Изображение
|
| 3395 |
+
type: image
|
| 3396 |
+
package: artworks
|
| 3397 |
+
script: |-
|
| 3398 |
+
const CHECK_TASK_INTERVAL = 3000;
|
| 3399 |
+
const MAX_ATTEMPTS = 100;
|
| 3400 |
+
|
| 3401 |
+
export async function run({ inputs, state }) {
|
| 3402 |
+
|
| 3403 |
+
const { FatalError, TimeoutError, RepeatNode, NextNode } = DEFINITIONS;
|
| 3404 |
+
const { ArtWorks, FatalError: ArtWorksError } = require('artworks');
|
| 3405 |
+
|
| 3406 |
+
const PAAS_BASE_URL = env.variables.get('PAAS_BASE_URL');
|
| 3407 |
+
if (!PAAS_BASE_URL) {
|
| 3408 |
+
throw new FatalError('Please, set PAAS_BASE_URL in environment');
|
| 3409 |
+
}
|
| 3410 |
+
const OPEN_PAAS_USER = env.variables.get('OPEN_PAAS_USER');
|
| 3411 |
+
if (!OPEN_PAAS_USER) {
|
| 3412 |
+
throw new FatalError('Please, set OPEN_PAAS_USER in environment');
|
| 3413 |
+
}
|
| 3414 |
+
const OPEN_PAAS_PASSWORD = env.variables.get('OPEN_PAAS_PASSWORD');
|
| 3415 |
+
if (!OPEN_PAAS_PASSWORD) {
|
| 3416 |
+
throw new FatalError('Please, set OPEN_PAAS_PASSWORD in environment');
|
| 3417 |
+
}
|
| 3418 |
+
|
| 3419 |
+
const artworks = new ArtWorks({
|
| 3420 |
+
baseUrl: PAAS_BASE_URL,
|
| 3421 |
+
username: OPEN_PAAS_USER,
|
| 3422 |
+
password: OPEN_PAAS_PASSWORD
|
| 3423 |
+
});
|
| 3424 |
+
|
| 3425 |
+
if (!state) {
|
| 3426 |
+
const { image, gender, prompt } = inputs;
|
| 3427 |
+
|
| 3428 |
+
const payload = {
|
| 3429 |
+
type: "dress-on-image",
|
| 3430 |
+
isFast: true,
|
| 3431 |
+
payload: {
|
| 3432 |
+
base64: false,
|
| 3433 |
+
image,
|
| 3434 |
+
gender,
|
| 3435 |
+
prompt
|
| 3436 |
+
},
|
| 3437 |
+
};
|
| 3438 |
+
try {
|
| 3439 |
+
const task = await artworks.createTask(payload);
|
| 3440 |
+
console.log(`Task created ${task}`);
|
| 3441 |
+
return RepeatNode.from({
|
| 3442 |
+
state: {
|
| 3443 |
+
payload,
|
| 3444 |
+
task,
|
| 3445 |
+
attempt: 0,
|
| 3446 |
+
startedAt: new Date()
|
| 3447 |
+
},
|
| 3448 |
+
progress: {
|
| 3449 |
+
total: MAX_ATTEMPTS,
|
| 3450 |
+
processed: 0
|
| 3451 |
+
},
|
| 3452 |
+
delay: 2000
|
| 3453 |
+
});
|
| 3454 |
+
} catch (e) {
|
| 3455 |
+
if (e instanceof ArtWorksError) {
|
| 3456 |
+
throw new FatalError(e.message);
|
| 3457 |
+
}
|
| 3458 |
+
throw e;
|
| 3459 |
+
}
|
| 3460 |
+
} else {
|
| 3461 |
+
const {
|
| 3462 |
+
payload,
|
| 3463 |
+
task,
|
| 3464 |
+
attempt,
|
| 3465 |
+
startedAt
|
| 3466 |
+
} = state;
|
| 3467 |
+
|
| 3468 |
+
if (attempt > MAX_ATTEMPTS) {
|
| 3469 |
+
try {
|
| 3470 |
+
await artworks.cancelTask(task);
|
| 3471 |
+
} catch (e) { }
|
| 3472 |
+
|
| 3473 |
+
const now = new Date();
|
| 3474 |
+
const time = (now - new Date(startedAt)) / 1000;
|
| 3475 |
+
throw new TimeoutError(`PaaS task for text to image ${task} timeout in ${time} sec`);
|
| 3476 |
+
}
|
| 3477 |
+
|
| 3478 |
+
console.log(`Check task ${attempt} ${task}`);
|
| 3479 |
+
|
| 3480 |
+
try {
|
| 3481 |
+
const results = await artworks.checkState(task);
|
| 3482 |
+
if (!results) {
|
| 3483 |
+
return RepeatNode.from({
|
| 3484 |
+
delay: CHECK_TASK_INTERVAL,
|
| 3485 |
+
state: {
|
| 3486 |
+
payload,
|
| 3487 |
+
task,
|
| 3488 |
+
attempt: attempt + 1,
|
| 3489 |
+
startedAt,
|
| 3490 |
+
},
|
| 3491 |
+
progress: {
|
| 3492 |
+
total: MAX_ATTEMPTS,
|
| 3493 |
+
processed: attempt
|
| 3494 |
+
},
|
| 3495 |
+
});
|
| 3496 |
+
}
|
| 3497 |
+
let images = results.images.map((i) => i.url);
|
| 3498 |
+
const [image] = images;
|
| 3499 |
+
return NextNode.from({
|
| 3500 |
+
outputs: {
|
| 3501 |
+
image
|
| 3502 |
+
}
|
| 3503 |
+
});
|
| 3504 |
+
} catch (e) {
|
| 3505 |
+
if (e instanceof ArtWorksError) {
|
| 3506 |
+
throw new FatalError(e.message);
|
| 3507 |
+
}
|
| 3508 |
+
throw e;
|
| 3509 |
+
}
|
| 3510 |
+
}
|
| 3511 |
+
}
|
| 3512 |
+
source: catalog
|
| 3513 |
+
title: en=Dress on image;ru=Переодеть
|
| 3514 |
+
version: 1
|
| 3515 |
+
text_to_video:
|
| 3516 |
+
_id: text_to_video
|
| 3517 |
+
arrange:
|
| 3518 |
+
x: 540
|
| 3519 |
+
y: 1100
|
| 3520 |
+
category:
|
| 3521 |
+
_id: generate_videos
|
| 3522 |
+
title: en=Generate videos;ru=Генерация видео
|
| 3523 |
+
environment:
|
| 3524 |
+
OPEN_PAAS_USER:
|
| 3525 |
+
title: PaaS user
|
| 3526 |
+
type: string
|
| 3527 |
+
scope: global
|
| 3528 |
+
OPEN_PAAS_PASSWORD:
|
| 3529 |
+
title: PaaS password
|
| 3530 |
+
type: string
|
| 3531 |
+
scope: global
|
| 3532 |
+
PAAS_BASE_URL:
|
| 3533 |
+
title: PaaS base url
|
| 3534 |
+
type: string
|
| 3535 |
+
scope: global
|
| 3536 |
+
execution: regular
|
| 3537 |
+
inputs:
|
| 3538 |
+
prompt:
|
| 3539 |
+
order: 1
|
| 3540 |
+
title: en=Prompt;ru=Подсказка
|
| 3541 |
+
type: string
|
| 3542 |
+
required: true
|
| 3543 |
+
multiline: true
|
| 3544 |
+
default: a sleek rocket launching from Earth
|
| 3545 |
+
totalFrames:
|
| 3546 |
+
order: 2
|
| 3547 |
+
title: en=Total frames;ru=Кол-во кадров
|
| 3548 |
+
type: integer
|
| 3549 |
+
min: 32
|
| 3550 |
+
max: 72
|
| 3551 |
+
step: 4
|
| 3552 |
+
default: 36
|
| 3553 |
+
fps:
|
| 3554 |
+
order: 3
|
| 3555 |
+
title: FPS
|
| 3556 |
+
type: integer
|
| 3557 |
+
min: 12
|
| 3558 |
+
max: 24
|
| 3559 |
+
step: 2
|
| 3560 |
+
default: 18
|
| 3561 |
+
outputs:
|
| 3562 |
+
video:
|
| 3563 |
+
title: en=Video;ru=Видео
|
| 3564 |
+
type: video
|
| 3565 |
+
package: artworks
|
| 3566 |
+
script: |-
|
| 3567 |
+
const CHECK_TASK_INTERVAL = 5000;
|
| 3568 |
+
const MAX_ATTEMPTS = 150;
|
| 3569 |
+
|
| 3570 |
+
export async function run({ inputs, state }) {
|
| 3571 |
+
|
| 3572 |
+
const { FatalError, TimeoutError, RepeatNode, NextNode } = DEFINITIONS;
|
| 3573 |
+
const { ArtWorks, FatalError: ArtWorksError } = require('artworks');
|
| 3574 |
+
|
| 3575 |
+
const PAAS_BASE_URL = env.variables.get('PAAS_BASE_URL');
|
| 3576 |
+
if (!PAAS_BASE_URL) {
|
| 3577 |
+
throw new FatalError('Please, set PAAS_BASE_URL in environment');
|
| 3578 |
+
}
|
| 3579 |
+
const OPEN_PAAS_USER = env.variables.get('OPEN_PAAS_USER');
|
| 3580 |
+
if (!OPEN_PAAS_USER) {
|
| 3581 |
+
throw new FatalError('Please, set OPEN_PAAS_USER in environment');
|
| 3582 |
+
}
|
| 3583 |
+
const OPEN_PAAS_PASSWORD = env.variables.get('OPEN_PAAS_PASSWORD');
|
| 3584 |
+
if (!OPEN_PAAS_PASSWORD) {
|
| 3585 |
+
throw new FatalError('Please, set OPEN_PAAS_PASSWORD in environment');
|
| 3586 |
+
}
|
| 3587 |
+
|
| 3588 |
+
const artworks = new ArtWorks({
|
| 3589 |
+
baseUrl: PAAS_BASE_URL,
|
| 3590 |
+
username: OPEN_PAAS_USER,
|
| 3591 |
+
password: OPEN_PAAS_PASSWORD
|
| 3592 |
+
});
|
| 3593 |
+
|
| 3594 |
+
if (!state) {
|
| 3595 |
+
const { prompt, totalFrames, fps } = inputs;
|
| 3596 |
+
|
| 3597 |
+
const payload = {
|
| 3598 |
+
type: "text-to-video",
|
| 3599 |
+
isFast: true,
|
| 3600 |
+
payload: {
|
| 3601 |
+
base64: false,
|
| 3602 |
+
prompt,
|
| 3603 |
+
numFrames: totalFrames || 36,
|
| 3604 |
+
fps: fps || 18
|
| 3605 |
+
},
|
| 3606 |
+
};
|
| 3607 |
+
try {
|
| 3608 |
+
const task = await artworks.createTask(payload);
|
| 3609 |
+
console.log(`Task created ${task}`);
|
| 3610 |
+
return RepeatNode.from({
|
| 3611 |
+
state: {
|
| 3612 |
+
payload,
|
| 3613 |
+
task,
|
| 3614 |
+
attempt: 0,
|
| 3615 |
+
startedAt: new Date()
|
| 3616 |
+
},
|
| 3617 |
+
progress: {
|
| 3618 |
+
total: MAX_ATTEMPTS,
|
| 3619 |
+
processed: 0
|
| 3620 |
+
},
|
| 3621 |
+
delay: 2000
|
| 3622 |
+
});
|
| 3623 |
+
} catch (e) {
|
| 3624 |
+
if (e instanceof ArtWorksError) {
|
| 3625 |
+
throw new FatalError(e.message);
|
| 3626 |
+
}
|
| 3627 |
+
throw e;
|
| 3628 |
+
}
|
| 3629 |
+
} else {
|
| 3630 |
+
const {
|
| 3631 |
+
payload,
|
| 3632 |
+
task,
|
| 3633 |
+
attempt,
|
| 3634 |
+
startedAt
|
| 3635 |
+
} = state;
|
| 3636 |
+
|
| 3637 |
+
if (attempt > MAX_ATTEMPTS) {
|
| 3638 |
+
try {
|
| 3639 |
+
await artworks.cancelTask(task);
|
| 3640 |
+
} catch (e) { }
|
| 3641 |
+
|
| 3642 |
+
const now = new Date();
|
| 3643 |
+
const time = (now - new Date(startedAt)) / 1000;
|
| 3644 |
+
throw new TimeoutError(`PaaS task for text to image ${task} timeout in ${time} sec`);
|
| 3645 |
+
}
|
| 3646 |
+
|
| 3647 |
+
console.log(`Check task ${attempt} ${task}`);
|
| 3648 |
+
|
| 3649 |
+
try {
|
| 3650 |
+
const results = await artworks.checkState(task);
|
| 3651 |
+
if (!results) {
|
| 3652 |
+
return RepeatNode.from({
|
| 3653 |
+
delay: CHECK_TASK_INTERVAL,
|
| 3654 |
+
state: {
|
| 3655 |
+
payload,
|
| 3656 |
+
task,
|
| 3657 |
+
attempt: attempt + 1,
|
| 3658 |
+
startedAt,
|
| 3659 |
+
},
|
| 3660 |
+
progress: {
|
| 3661 |
+
total: MAX_ATTEMPTS,
|
| 3662 |
+
processed: attempt
|
| 3663 |
+
},
|
| 3664 |
+
});
|
| 3665 |
+
}
|
| 3666 |
+
let { video: { url: video } } = results;
|
| 3667 |
+
return NextNode.from({
|
| 3668 |
+
outputs: {
|
| 3669 |
+
video
|
| 3670 |
+
}
|
| 3671 |
+
});
|
| 3672 |
+
} catch (e) {
|
| 3673 |
+
if (e instanceof ArtWorksError) {
|
| 3674 |
+
throw new FatalError(e.message);
|
| 3675 |
+
}
|
| 3676 |
+
throw e;
|
| 3677 |
+
}
|
| 3678 |
+
}
|
| 3679 |
+
}
|
| 3680 |
+
source: catalog
|
| 3681 |
+
title: en=Text to video;ru=Сгенерировать видео
|
| 3682 |
+
version: 1
|
| 3683 |
+
pulid:
|
| 3684 |
+
_id: pulid
|
| 3685 |
+
arrange:
|
| 3686 |
+
x: 910
|
| 3687 |
+
y: 1100
|
| 3688 |
+
category:
|
| 3689 |
+
_id: deep_swap
|
| 3690 |
+
title: en=Deep swap;ru=Глубокая замена
|
| 3691 |
+
environment:
|
| 3692 |
+
OPEN_PAAS_USER:
|
| 3693 |
+
title: PaaS user
|
| 3694 |
+
type: string
|
| 3695 |
+
scope: global
|
| 3696 |
+
OPEN_PAAS_PASSWORD:
|
| 3697 |
+
title: PaaS password
|
| 3698 |
+
type: string
|
| 3699 |
+
scope: global
|
| 3700 |
+
PAAS_BASE_URL:
|
| 3701 |
+
title: PaaS base url
|
| 3702 |
+
type: string
|
| 3703 |
+
scope: global
|
| 3704 |
+
execution: regular
|
| 3705 |
+
inputs:
|
| 3706 |
+
person:
|
| 3707 |
+
order: 1
|
| 3708 |
+
title: en=Person;ru=Персона
|
| 3709 |
+
type: image
|
| 3710 |
+
required: true
|
| 3711 |
+
prompt:
|
| 3712 |
+
order: 2
|
| 3713 |
+
title: en=Prompt;ru=Подсказка
|
| 3714 |
+
type: string
|
| 3715 |
+
required: true
|
| 3716 |
+
multiline: true
|
| 3717 |
+
outputs:
|
| 3718 |
+
image:
|
| 3719 |
+
title: ""
|
| 3720 |
+
type: image
|
| 3721 |
+
package: artworks
|
| 3722 |
+
script: |-
|
| 3723 |
+
const CHECK_TASK_INTERVAL = 5000;
|
| 3724 |
+
const MAX_ATTEMPTS = 150;
|
| 3725 |
+
|
| 3726 |
+
export async function run({ inputs, state }) {
|
| 3727 |
+
|
| 3728 |
+
const { FatalError, TimeoutError, RepeatNode, NextNode } = DEFINITIONS;
|
| 3729 |
+
const { ArtWorks, FatalError: ArtWorksError } = require('artworks');
|
| 3730 |
+
|
| 3731 |
+
const PAAS_BASE_URL = env.variables.get('PAAS_BASE_URL');
|
| 3732 |
+
if (!PAAS_BASE_URL) {
|
| 3733 |
+
throw new FatalError('Please, set PAAS_BASE_URL in environment');
|
| 3734 |
+
}
|
| 3735 |
+
const OPEN_PAAS_USER = env.variables.get('OPEN_PAAS_USER');
|
| 3736 |
+
if (!OPEN_PAAS_USER) {
|
| 3737 |
+
throw new FatalError('Please, set OPEN_PAAS_USER in environment');
|
| 3738 |
+
}
|
| 3739 |
+
const OPEN_PAAS_PASSWORD = env.variables.get('OPEN_PAAS_PASSWORD');
|
| 3740 |
+
if (!OPEN_PAAS_PASSWORD) {
|
| 3741 |
+
throw new FatalError('Please, set OPEN_PAAS_PASSWORD in environment');
|
| 3742 |
+
}
|
| 3743 |
+
|
| 3744 |
+
const artworks = new ArtWorks({
|
| 3745 |
+
baseUrl: PAAS_BASE_URL,
|
| 3746 |
+
username: OPEN_PAAS_USER,
|
| 3747 |
+
password: OPEN_PAAS_PASSWORD
|
| 3748 |
+
});
|
| 3749 |
+
|
| 3750 |
+
if (!state) {
|
| 3751 |
+
const { person, prompt } = inputs;
|
| 3752 |
+
|
| 3753 |
+
const payload = {
|
| 3754 |
+
type: 'run-comfy',
|
| 3755 |
+
isFast: true,
|
| 3756 |
+
payload: {
|
| 3757 |
+
pipeline: 'pullid',
|
| 3758 |
+
args: {
|
| 3759 |
+
image: person,
|
| 3760 |
+
prompt,
|
| 3761 |
+
aspect_ratio: '9:16',
|
| 3762 |
+
}
|
| 3763 |
+
},
|
| 3764 |
+
};
|
| 3765 |
+
try {
|
| 3766 |
+
const task = await artworks.createTask(payload);
|
| 3767 |
+
console.log(`Task created ${task}`);
|
| 3768 |
+
return RepeatNode.from({
|
| 3769 |
+
state: {
|
| 3770 |
+
payload,
|
| 3771 |
+
task,
|
| 3772 |
+
attempt: 0,
|
| 3773 |
+
startedAt: new Date()
|
| 3774 |
+
},
|
| 3775 |
+
progress: {
|
| 3776 |
+
total: MAX_ATTEMPTS,
|
| 3777 |
+
processed: 0
|
| 3778 |
+
},
|
| 3779 |
+
delay: 2000
|
| 3780 |
+
});
|
| 3781 |
+
} catch (e) {
|
| 3782 |
+
if (e instanceof ArtWorksError) {
|
| 3783 |
+
throw new FatalError(e.message);
|
| 3784 |
+
}
|
| 3785 |
+
throw e;
|
| 3786 |
+
}
|
| 3787 |
+
} else {
|
| 3788 |
+
const {
|
| 3789 |
+
payload,
|
| 3790 |
+
task,
|
| 3791 |
+
attempt,
|
| 3792 |
+
startedAt
|
| 3793 |
+
} = state;
|
| 3794 |
+
|
| 3795 |
+
if (attempt > MAX_ATTEMPTS) {
|
| 3796 |
+
try {
|
| 3797 |
+
await artworks.cancelTask(task);
|
| 3798 |
+
} catch (e) { }
|
| 3799 |
+
|
| 3800 |
+
const now = new Date();
|
| 3801 |
+
const time = (now - new Date(startedAt)) / 1000;
|
| 3802 |
+
throw new TimeoutError(`PaaS task for text to image ${task} timeout in ${time} sec`);
|
| 3803 |
+
}
|
| 3804 |
+
|
| 3805 |
+
console.log(`Check task ${attempt} ${task}`);
|
| 3806 |
+
|
| 3807 |
+
try {
|
| 3808 |
+
const results = await artworks.checkState(task);
|
| 3809 |
+
if (!results) {
|
| 3810 |
+
return RepeatNode.from({
|
| 3811 |
+
delay: CHECK_TASK_INTERVAL,
|
| 3812 |
+
state: {
|
| 3813 |
+
payload,
|
| 3814 |
+
task,
|
| 3815 |
+
attempt: attempt + 1,
|
| 3816 |
+
startedAt,
|
| 3817 |
+
},
|
| 3818 |
+
progress: {
|
| 3819 |
+
total: MAX_ATTEMPTS,
|
| 3820 |
+
processed: attempt
|
| 3821 |
+
},
|
| 3822 |
+
});
|
| 3823 |
+
}
|
| 3824 |
+
const { images: [{ url: image }] } = results;
|
| 3825 |
+
return NextNode.from({
|
| 3826 |
+
outputs: { image }
|
| 3827 |
+
});
|
| 3828 |
+
} catch (e) {
|
| 3829 |
+
if (e instanceof ArtWorksError) {
|
| 3830 |
+
throw new FatalError(e.message);
|
| 3831 |
+
}
|
| 3832 |
+
throw e;
|
| 3833 |
+
}
|
| 3834 |
+
}
|
| 3835 |
+
}
|
| 3836 |
+
source: catalog
|
| 3837 |
+
title: PuLID
|
| 3838 |
+
version: 1
|