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(p.x * 15.0 + sin(p.y * 15.0) + time), cos(p.y * 30.0 - cos(p.x * 20.0) + time)) / vec2(i, i);
}
{
"completed_at": "2024-11-22T17:56:45.450258Z",
"created_at": "2024-11-22T17:56:42.438000Z",
"data_removed": false,
"error": null,
"id": "9xkk5e6x8srgg0ckam2b4b49fw",
"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 = 8320.92 ms\nllama_print_timings: sample time = 1518.21 ms / 87 runs ( 17.45 ms per token, 57.30 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 = 1263.33 ms / 87 runs ( 14.52 ms per token, 68.87 tokens per second)\nllama_print_timings: total time = 2994.77 ms",
"metrics": {
"predict_time": 3.004472856,
"total_time": 3.012258
},
"output": [
"vec",
"2",
" effect",
"(",
"vec",
"2",
" p",
",",
" float",
" i",
",",
" float",
" time",
")",
" {",
"\n",
" ",
" return",
" vec",
"2",
"(",
"sin",
"(",
"p",
".",
"x",
" *",
" ",
"1",
"5",
".",
"0",
" +",
" sin",
"(",
"p",
".",
"y",
" *",
" ",
"1",
"5",
".",
"0",
")",
" +",
" time",
"),",
" cos",
"(",
"p",
".",
"y",
" *",
" ",
"3",
"0",
".",
"0",
" -",
" cos",
"(",
"p",
".",
"x",
" *",
" ",
"2",
"0",
".",
"0",
")",
" +",
" time",
"))",
" /",
" ",
"vec",
"2",
"(",
"i",
",",
" i",
");",
"\n",
"}"
],
"started_at": "2024-11-22T17:56:42.445785Z",
"status": "succeeded",
"urls": {
"stream": "https://stream-g.svc.us.c.replicate.net/v1/streams/lqcqzgl62at2kcdhtlfpgfbblifcfqoyoxnewmdzq2ccyy24egka",
"get": "https://api.replicate.com/v1/predictions/9xkk5e6x8srgg0ckam2b4b49fw",
"cancel": "https://api.replicate.com/v1/predictions/9xkk5e6x8srgg0ckam2b4b49fw/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 = 8320.92 ms
llama_print_timings: sample time = 1518.21 ms / 87 runs ( 17.45 ms per token, 57.30 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 = 1263.33 ms / 87 runs ( 14.52 ms per token, 68.87 tokens per second)
llama_print_timings: total time = 2994.77 ms