Computerender service connection

Hi. I’m thinking of an interactive installation using Stable Diffusion. I found a service called Computerender that allows you to render online for a small fee, it’s quite fast, and you don’t need superfast and expensive graphics cards. I would like to integrate this service with vvvv, but I can’t handle it. The service offers scripts: curl, Node.js and python. I would like to be able to enter all the text data and a sample image from vvvv, and receive the image generated by Stable Diffusion into vvvv. Maybe someone could help me?This is what the curl script looks like:

curl “https://api.computerender.com/generate
-F prompt=“someting”
-F w=576
-F h=640
-F img=@GR portre_small.jpg
-H “Authorization: X-API-Key sk_PUT_API_KEY_HERE” \

results.jpg

this is the node.js script:

npm i computerender
import fs from "fs";
import {Computerender} from "computerender";

const cr = new Computerender("sk_PUT_API_KEY_HERE");

const params = {
  prompt: "someting",
  w: 576,
  h: 640,
  img: fs.readFileSync("GR portre_small.jpg")
};

const imageResult = await cr.generateImage(params);

// Optionally write to file 
fs.writeFileSync("result.jpg", imageResult);

and this is python:
pip install computerender

import asyncio
from computerender import Computerender
                
cr = Computerender()

with open("GR portre_small.jpg", "rb") as f:
  img = f.read()

img_bytes = asyncio.run(
  cr.generate(
    "someting",
    w=576,
    h=640,
    img=img
  )
)

# optionally write to file
with open("result.jpg", "wb") as f:
  f.write(img_bytes)

Any thoughts?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.