Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
iMactool committed May 30, 2023
1 parent af95fd2 commit 2d7039b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ use Imactool\HyperfStableDiffusion\Replicate;
->highlyDetailed()
->dramaticLighting()
->octaneRender()
)->generate(3);
)->inputParams('num_outputs', 1)
->generate(); //根据不同的模型来传递生成的张数
```

### 图片生成图片(Image to Image)
Expand All @@ -82,7 +83,8 @@ $result = Replicate::make()
->inputParams('num_inference_steps', 25)
->inputParams('guidance_scale', 7.5)
->inputParams('scheduler', 'EulerAncestralDiscrete')
->generate(1);
->inputParams('num_outputs', 1)
->generate();
```


Expand Down
6 changes: 3 additions & 3 deletions src/Replicate.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ public function height(int $height)
return $this;
}

public function generate(int $numberOfImages)
public function generate()
{
assert($this->prompt !== null, 'You must provide a prompt');
assert($numberOfImages > 0, 'You must provide a number greater than 0');
// assert($numberOfImages > 0, 'You must provide a number greater than 0');

$input = [
'prompt' => $this->prompt->toString(),
'num_outputs' => $numberOfImages,
// 'num_outputs' => $numberOfImages,
];

$input = array_merge($input, $this->inputParams);
Expand Down

0 comments on commit 2d7039b

Please sign in to comment.