You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/inference/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,6 @@ A Typescript powered wrapper for the Hugging Face Inference API. Learn more abou
4
4
5
5
Check out the [full documentation](https://huggingface.co/docs/huggingface.js/inference/README) or try out a live [interactive notebook](https://observablehq.com/@huggingface/hello-huggingface-js-inference).
6
6
7
-
8
-
9
7
## Install
10
8
11
9
```console
@@ -18,7 +16,7 @@ pnpm add @huggingface/inference
18
16
19
17
## Usage
20
18
21
-
❗**Important note:** Using an API key is optional to get started, however you will be rate limited eventually. Join [Hugging Face](https://huggingface.co/join) and then visit [access tokens](https://huggingface.co/settings/tokens) to generate your API key for **free**.
19
+
❗**Important note:** Using an API key is optional to get started, however you will be rate limited eventually. Join [Hugging Face](https://huggingface.co/join) and then visit [access tokens](https://huggingface.co/settings/tokens) to generate your API key for **free**.
22
20
23
21
Your API key should be kept private. If you need to protect it in front-end applications, we suggest setting up a proxy server that stores the API key.
24
22
@@ -154,8 +152,10 @@ await hf.imageSegmentation({
154
152
155
153
awaithf.textToImage({
156
154
inputs: 'award winning high resolution photo of a giant tortoise/((ladybird)) hybrid, [trending on artstation]',
* An optional negative prompt for the image generation
587
-
*/
588
-
negative_prompt?: string;
585
+
parameters?: {
586
+
/**
587
+
* An optional negative prompt for the image generation
588
+
*/
589
+
negative_prompt?: string;
590
+
/**
591
+
* The height in pixels of the generated image
592
+
*/
593
+
height?: number;
594
+
/**
595
+
* The width in pixels of the generated image
596
+
*/
597
+
width?: number;
598
+
/**
599
+
* The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference.
600
+
*/
601
+
num_inference_steps?: number;
602
+
/**
603
+
* Guidance scale: Higher guidance scale encourages to generate images that are closely linked to the text `prompt`, usually at the expense of lower image quality.
0 commit comments