Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
andreasjansson /plasma:cc8fda9d
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run andreasjansson/plasma using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"andreasjansson/plasma:cc8fda9d792ea48be0bd70b66966614acdee2e2b7612fbb820ed1908b410a952",
{
input: {}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run andreasjansson/plasma using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run("andreasjansson/plasma:cc8fda9d792ea48be0bd70b66966614acdee2e2b7612fbb820ed1908b410a952")
# The andreasjansson/plasma model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/andreasjansson/plasma/api#output-schema
print(item, end="")
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run andreasjansson/plasma using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "andreasjansson/plasma:cc8fda9d792ea48be0bd70b66966614acdee2e2b7612fbb820ed1908b410a952",
"input": {}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
vec2 effect(vec2 p, float i, float time) {
return vec2(sin(length(p.x) * length(p.y) * i + time), cos(length(p.x) * length(p.y) * i - time));
}
{
"completed_at": "2023-12-07T12:13:29.745194Z",
"created_at": "2023-12-07T12:13:25.057641Z",
"data_removed": false,
"error": null,
"id": "jji3fr3bucnr3mq7dsad6iwldi",
"input": {},
"logs": "from_string grammar:\nroot ::= [v] [e] [c] [2] [ ] [e] [f] [f] [e] [c] [t] [(] [v] [e] [c] [2] [ ] [p] [,] [ ] [f] [l] [o] [a] [t] [ ] [i] [,] [ ] [f] [l] [o] [a] [t] [ ] [t] [i] [m] [e] [)] [ ] [{] [<U+000A>] [ ] [ ] return-statement [<U+000A>] [}] \nreturn-statement ::= [r] [e] [t] [u] [r] [n] [ ] vec2-expression [;]\nvec2-expression ::= single-vec2-expression | single-vec2-expression operation vec2-expression\nsingle-vec2-expression ::= [v] [e] [c] [2] [(] scalar-expression [,] [ ] scalar-expression [)]\noperation ::= [ ] [+] [ ] | [ ] [-] [ ] | [ ] [*] [ ] | [ ] [/] [ ]\nscalar-expression ::= single-scalar-expression | single-scalar-expression operation scalar-expression\nsingle-scalar-expression ::= float-literal | variable | math-func [(] math-arg [)]\nfloat-literal ::= float-literal_11 [.] float-literal_12\nvariable ::= [p] [.] [x] | [p] [.] [y] | [i] | [t] [i] [m] [e]\nmath-func ::= [s] [i] [n] | [c] [o] [s] | [t] [a] [n] | [l] [e] [n] [g] [t] [h] | [s] [q] [r] [t] | [e] [x] [p]\nmath-arg ::= [p] [.] [x] | [p] [.] [y] | scalar-expression \nfloat-literal_11 ::= [0-9] float-literal_11 | [0-9]\nfloat-literal_12 ::= [0-9] float-literal_12 | [0-9]\nLlama.generate: prefix-match hit\nllama_print_timings: load time = 314.60 ms\nllama_print_timings: sample time = 3573.61 ms / 64 runs ( 55.84 ms per token, 17.91 tokens per second)\nllama_print_timings: prompt eval time = 0.00 ms / 1 tokens ( 0.00 ms per token, inf tokens per second)\nllama_print_timings: eval time = 938.93 ms / 64 runs ( 14.67 ms per token, 68.16 tokens per second)\nllama_print_timings: total time = 4668.46 ms",
"metrics": {
"predict_time": 4.680982,
"total_time": 4.687553
},
"output": [
"vec",
"2",
" effect",
"(",
"vec",
"2",
" p",
",",
" float",
" i",
",",
" float",
" time",
")",
" {",
"\n",
" ",
"return",
" vec",
"2",
"(",
"sin",
"(",
"length",
"(",
"p",
".",
"x",
")",
" *",
" length",
"(",
"p",
".",
"y",
")",
" *",
" i",
" +",
" time",
"),",
" cos",
"(",
"length",
"(",
"p",
".",
"x",
")",
" *",
" length",
"(",
"p",
".",
"y",
")",
" *",
" i",
" -",
" time",
"));",
"\n",
"}"
],
"started_at": "2023-12-07T12:13:25.064212Z",
"status": "succeeded",
"urls": {
"stream": "https://streaming-api.svc.us.c.replicate.net/v1/predictions/jji3fr3bucnr3mq7dsad6iwldi",
"get": "https://api.replicate.com/v1/predictions/jji3fr3bucnr3mq7dsad6iwldi",
"cancel": "https://api.replicate.com/v1/predictions/jji3fr3bucnr3mq7dsad6iwldi/cancel"
},
"version": "cc8fda9d792ea48be0bd70b66966614acdee2e2b7612fbb820ed1908b410a952"
}
from_string grammar:
root ::= [v] [e] [c] [2] [ ] [e] [f] [f] [e] [c] [t] [(] [v] [e] [c] [2] [ ] [p] [,] [ ] [f] [l] [o] [a] [t] [ ] [i] [,] [ ] [f] [l] [o] [a] [t] [ ] [t] [i] [m] [e] [)] [ ] [{] [<U+000A>] [ ] [ ] return-statement [<U+000A>] [}]
return-statement ::= [r] [e] [t] [u] [r] [n] [ ] vec2-expression [;]
vec2-expression ::= single-vec2-expression | single-vec2-expression operation vec2-expression
single-vec2-expression ::= [v] [e] [c] [2] [(] scalar-expression [,] [ ] scalar-expression [)]
operation ::= [ ] [+] [ ] | [ ] [-] [ ] | [ ] [*] [ ] | [ ] [/] [ ]
scalar-expression ::= single-scalar-expression | single-scalar-expression operation scalar-expression
single-scalar-expression ::= float-literal | variable | math-func [(] math-arg [)]
float-literal ::= float-literal_11 [.] float-literal_12
variable ::= [p] [.] [x] | [p] [.] [y] | [i] | [t] [i] [m] [e]
math-func ::= [s] [i] [n] | [c] [o] [s] | [t] [a] [n] | [l] [e] [n] [g] [t] [h] | [s] [q] [r] [t] | [e] [x] [p]
math-arg ::= [p] [.] [x] | [p] [.] [y] | scalar-expression
float-literal_11 ::= [0-9] float-literal_11 | [0-9]
float-literal_12 ::= [0-9] float-literal_12 | [0-9]
Llama.generate: prefix-match hit
llama_print_timings: load time = 314.60 ms
llama_print_timings: sample time = 3573.61 ms / 64 runs ( 55.84 ms per token, 17.91 tokens per second)
llama_print_timings: prompt eval time = 0.00 ms / 1 tokens ( 0.00 ms per token, inf tokens per second)
llama_print_timings: eval time = 938.93 ms / 64 runs ( 14.67 ms per token, 68.16 tokens per second)
llama_print_timings: total time = 4668.46 ms