Skip to content

Commit

Permalink
add -i flag info to readme (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
PBillingsby authored May 23, 2024
1 parent 978ee94 commit 097ed75
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ An API endpoint that wraps using the Lilypad cli.

Run `node src/index.js` to create a local endpoint using the js wrapper with either `src/run.js` or `src/stream.js`, then send a post request containing json with your funded `WEB3_PRIVATE_KEY` key set, see the quick start for more on [getting started](https://docs.lilypad.tech/lilypad/lilypad-milky-way-testnet/quick-start)

In `inputs`, each input must be preceeded by the `-i` flag, including tunables. For example:
`"inputs": "-i Prompt='an astronaut floating against a white background' -i Steps=50"`

The endpoint can then be tested using curl
```
curl -X POST http://localhost:3000 \
-H "Content-Type: application/json" \
-d '{"pk": "'"$WEB3_PRIVATE_KEY"'", "module": "github.com/lilypad-tech/lilypad-module-lilysay:0.1.0", "inputs": "Message=test"}'
-d '{"pk": "'"$WEB3_PRIVATE_KEY"'", "module": "github.com/lilypad-tech/lilypad-module-lilysay:0.1.0", "inputs": "-i Message=test"}'
```

```js
Expand All @@ -21,7 +24,7 @@ const { run } = require("./")
run(
"private-key",
"module name"
'payload (key=value)'
'-i payload (key=value)'
).then((res) => {
console.log(res)
})
Expand All @@ -34,7 +37,7 @@ const { stream } = require("./")
stream(
"private-key",
"module name"
'payload (key=value)'
'-i payload (key=value)'
{ stream: true },
).then(() => {
console.log("Result in ./output/result")
Expand Down

0 comments on commit 097ed75

Please sign in to comment.