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.
georgedavila /cog-easytex:8c7cdd22
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 georgedavila/cog-easytex using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"georgedavila/cog-easytex:8c7cdd2206f6db7ed933ce2c7ed4cff148130a274c35bfb03d55bb21accb11ff",
{
input: {
bodyInput: "#SECTION A \n Hello \n #SUBSECTION B \n Lorem ipsum..."
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", 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 georgedavila/cog-easytex using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"georgedavila/cog-easytex:8c7cdd2206f6db7ed933ce2c7ed4cff148130a274c35bfb03d55bb21accb11ff",
input={
"bodyInput": "#SECTION A \n Hello \n #SUBSECTION B \n Lorem ipsum..."
}
)
print(output)
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 georgedavila/cog-easytex 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": "georgedavila/cog-easytex:8c7cdd2206f6db7ed933ce2c7ed4cff148130a274c35bfb03d55bb21accb11ff",
"input": {
"bodyInput": "#SECTION A \\n Hello \\n #SUBSECTION B \\n Lorem ipsum..."
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{
"completed_at": "2024-05-07T21:34:25.809025Z",
"created_at": "2024-05-07T21:32:52.914000Z",
"data_removed": false,
"error": null,
"id": "qzte6g2369rge0cfakwr5tjwm0",
"input": {
"bodyInput": "#SECTION A \n Hello \n #SUBSECTION B \n Lorem ipsum..."
},
"logs": "['#SECTION A ', ' Hello ', ' #SUBSECTION B ', ' Lorem ipsum...']\nfrom pylatex import Document, Section, Subsection, Subsubsection, Command\nfrom pylatex.utils import italic, NoEscape\nfrom pylatex.section import Chapter, Paragraph, Subparagraph\ndef fill_document(doc):\nwith doc.create(Section(\"A \")):\ndoc.append( NoEscape(\" Hello \") )\nwith doc.create(Subsection(\"B \")):\ndoc.append( NoEscape(\" Lorem ipsum...\") )",
"metrics": {
"predict_time": 1.00495,
"total_time": 92.895025
},
"output": "https://replicate.delivery/pbxt/CpM4DKlyI6bqEx0pIxeunN62axTVXW8fiFBQfTVbRBvCDKklA/generated.pdf",
"started_at": "2024-05-07T21:34:24.804075Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/qzte6g2369rge0cfakwr5tjwm0",
"cancel": "https://api.replicate.com/v1/predictions/qzte6g2369rge0cfakwr5tjwm0/cancel"
},
"version": "8c7cdd2206f6db7ed933ce2c7ed4cff148130a274c35bfb03d55bb21accb11ff"
}
['#SECTION A ', ' Hello ', ' #SUBSECTION B ', ' Lorem ipsum...']
from pylatex import Document, Section, Subsection, Subsubsection, Command
from pylatex.utils import italic, NoEscape
from pylatex.section import Chapter, Paragraph, Subparagraph
def fill_document(doc):
with doc.create(Section("A ")):
doc.append( NoEscape(" Hello ") )
with doc.create(Subsection("B ")):
doc.append( NoEscape(" Lorem ipsum...") )