mypiper commited on
Commit
f9e7707
·
verified ·
1 Parent(s): b3de068

Update replicate.yaml

Browse files
Files changed (1) hide show
  1. replicate.yaml +4 -9
replicate.yaml CHANGED
@@ -12,14 +12,9 @@ nodes:
12
  x: 300
13
  y: 120
14
  category:
 
15
  id: generate_images
16
  title: en=Generate images;ru=Генерация изображений
17
- costs: |-
18
- const COST_PER_IMAGE = 0.01;
19
- (() => {
20
- const { imagesCount } = inputs;
21
- return imagesCount * COST_PER_IMAGE;
22
- })()
23
  environment:
24
  REPLICATE_TOKEN:
25
  title: Replicate token
@@ -80,11 +75,11 @@ nodes:
80
  script: |
81
  export async function run({ inputs, state }) {
82
 
83
- const { RepeatNode, NextNode } = DEFINITIONS;
84
 
85
  const REPLICATE_TOKEN = env?.variables?.get('REPLICATE_TOKEN');
86
  if (!REPLICATE_TOKEN) {
87
- error.fatal('Please, set your API token for Replicate AI');
88
  }
89
 
90
  const { prompt, imagesCount, aspectRatio } = inputs;
@@ -122,7 +117,7 @@ nodes:
122
  const { status, error } = data;
123
  switch (status) {
124
  case 'processing':
125
- return repeat({ state: { task }, delay: 3000 });
126
  case 'failed':
127
  error.fatal(error);
128
  case 'succeeded':
 
12
  x: 300
13
  y: 120
14
  category:
15
+ _id: generate_images
16
  id: generate_images
17
  title: en=Generate images;ru=Генерация изображений
 
 
 
 
 
 
18
  environment:
19
  REPLICATE_TOKEN:
20
  title: Replicate token
 
75
  script: |
76
  export async function run({ inputs, state }) {
77
 
78
+ const { RepeatNode, NextNode, FatalError } = DEFINITIONS;
79
 
80
  const REPLICATE_TOKEN = env?.variables?.get('REPLICATE_TOKEN');
81
  if (!REPLICATE_TOKEN) {
82
+ throw new FatalError('Please, set your API token for Replicate AI');
83
  }
84
 
85
  const { prompt, imagesCount, aspectRatio } = inputs;
 
117
  const { status, error } = data;
118
  switch (status) {
119
  case 'processing':
120
+ return RepeatNode.from({ state: { task }, delay: 3000 });
121
  case 'failed':
122
  error.fatal(error);
123
  case 'succeeded':