Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
olokobayusuf committed Jun 11, 2024
1 parent d5730b0 commit c4306c6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ $ pip install --upgrade fxn
> [!NOTE]
> Function requires Python 3.9+
## Retrieving your Access Key
Head over to [fxn.ai](https://fxn.ai) to create an account by logging in. Once you do, generate an access key:

![generate access key](https://raw.githubusercontent.com/fxnai/.github/main/access_key.gif)

## Making a Prediction
Let's run the [`@samples/stable-diffusion`](https://fxn.ai/@samplefxn/stable-diffusion) predictor which accepts a text `prompt` and generates a corresponding image. Run the following Python script:
```py
from fxn import Function

# Create the Function client
fxn = Function()
fxn = Function(access_key="<ACCESS KEY>")
# Create a prediction
prediction = fxn.predictions.create(
tag="@samples/stable-diffusion",
Expand All @@ -42,6 +47,9 @@ image.show()
Open up a terminal and run the following command:

```sh
# Login to Function
fxn auth login <ACCESS KEY>

# Make a prediction using the Function CLI
fxn predict @samplefxn/stable-diffusion \
--prompt "An astronaut riding a horse on the moon"
Expand Down

0 comments on commit c4306c6

Please sign in to comment.