For AI agents: this page is also available as Markdown at https://docs.refabric.com/task-api-reference/records-libraries.md, and the index of every page is https://docs.refabric.com/llms.txt.
Records & libraries
Makes the records and library items other tasks take: moodboards, brand kits, range plans, fabrics, poses and backgrounds.
Tasks
Create a moodboard
Analyse 10 to 60 images into a moodboard — its palette, fabrics, prints, key items and keywords — delivered as a `moodboard:` record you can read, and pass to generation.
Create a fabric
Turn photos of a fabric into a library fabric you can design with, rendered in every extra colour you ask for. The result is the fabric record, fabric:<id>.
Add a colour to a fabric
Render one more colour of a fabric you made with fabric.create. The result is the same fabric record with the new colour in it.
Create a brand kit
Create a brand kit from your colours and your looks, fabrics, prints and other images. The kit is ready to read at once; its items are prepared so generation can use them.
Create a range plan
Plan a collection from your moodboards: isolate garments from runway looks, or design new pieces line by line. The plan is delivered as one record whose items are its images.
Add a pose
Turn a photo of a person posing into a pose in your library, to shoot or re-pose models in. The result is the pose, pose:<id>.
Add a background
Turn a photo of a place, or of a studio backdrop, into a background in your library: background:<id>.
Quick start
moodboard.create
import os
import time
import requests
headers = {"Authorization": f"Key {os.environ['REFABRIC_API_KEY']}"}
job = requests.post(
"https://api.refabric.com/v1/tasks/moodboard.create",
headers=headers,
json={
"images": [
"https://example.com/looks/1.jpg",
"https://example.com/looks/2.jpg",
"https://example.com/looks/3.jpg",
"https://example.com/looks/4.jpg",
"https://example.com/looks/5.jpg",
"https://example.com/looks/6.jpg",
"https://example.com/looks/7.jpg",
"https://example.com/looks/8.jpg",
"https://example.com/looks/9.jpg",
"art:9f3c01",
],
},
).json()
print(job["job_id"])
while True:
status = requests.get(job["status_url"], headers=headers).json()
if status["lifecycle"] == "terminal":
break
time.sleep(5)
print(requests.get(job["result_url"], headers=headers).json())