1, ]; } public function getOptionalInputShape(): array { return [ 'size' => new ShapeDescriptor( 'Size', 'Optional. The size of the generated images. Must be in 256x256 format.', EShapeType::Text ), ]; } public function getOptionalInputShapeEnumValues(): array { return []; } public function getOptionalInputShapeDefaults(): array { return []; } public function getOutputShapeEnumValues(): array { return []; } public function getOptionalOutputShape(): array { return []; } public function getOptionalOutputShapeEnumValues(): array { return []; } public function process(?string $userId, array $input, callable $reportProgress): array { if ($this->appConfig->getAppValueBool('fail-' . $this->getId())) { throw new ProcessingException('Failing as set by AppConfig'); } if (!isset($input['input']) || !is_string($input['input'])) { throw new RuntimeException('Invalid prompt'); } $prompt = $input['input']; $nbImages = 1; if (isset($input['numberOfImages']) && is_int($input['numberOfImages'])) { $nbImages = $input['numberOfImages']; } $fakeContent = file_get_contents(__DIR__ . '/../../img/logo.png'); $output = ['images' => []]; foreach (range(1, $nbImages) as $i) { $output['images'][] = $fakeContent; } /** @var array|numeric|string> $output */ return $output; } }