tryiton 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/tryiton/client.rb +7 -1
- data/lib/tryiton/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c29cb70e6a0857471cb63749df6c190bb0d19c778069f7b03a24c20815732d6
|
|
4
|
+
data.tar.gz: 1e2b498866ed7fa33d7c221f5a5b81ae5c377a5536b681a2c38838a23a3414e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b3d0a9ec7b6b952364520a361001dff2a295d8a7f9a2059d1eb94919938eeba070765506f0d721849af0990e4b2435b35e2474eb57de9f1757cef8ff113f0f2
|
|
7
|
+
data.tar.gz: 81d717005e65bbf86dca449c06535acfd464289bf62ee189d48ab449dd8ec732c392b2f4227b1814e7f61ffa00dbb0e862403963d6e227d14403894f2225a14e
|
data/README.md
CHANGED
|
@@ -54,7 +54,7 @@ Image inputs accept a public URL or a base64 data URL (`data:image/png;base64,..
|
|
|
54
54
|
| --------- | ---- | -------- | ----------- |
|
|
55
55
|
| `model_image` | String | Yes | URL or base64 data URL of the person. |
|
|
56
56
|
| `garment_image` | String | Yes | URL or base64 data URL of the garment or accessory. |
|
|
57
|
-
| `category` | String | No | Item type: `auto`, `clothing`, `eyewear`, `footwear`, `headwear`, `jewelry`,
|
|
57
|
+
| `category` | String | No | Item type: `auto`, `clothing`, `eyewear`, `footwear`, `headwear`, `jewelry`, or `accessories`. `auto` detects it for you. |
|
|
58
58
|
| `subcategory` | String | No | Required for `clothing` (`tops`, `bottoms`, `dresses`), `jewelry`, and `accessories`. |
|
|
59
59
|
|
|
60
60
|
Additional options (`mode` and `moderation_level` for clothing; `num_samples` 1–4 and `output_format` `png`/`jpeg` for every try-on, including hairstyle and tattoo) are documented in the [API reference](https://docs.tryiton.now).
|
|
@@ -65,8 +65,10 @@ Additional options (`mode` and `moderation_level` for clothing; `num_samples` 1
|
|
|
65
65
|
# Hairstyle try-on (see Tryiton::HAIRCUTS for all supported values)
|
|
66
66
|
client.try_on_hairstyle(face_image: face_url, haircut: "BuzzCut", hair_color: "ash blonde")
|
|
67
67
|
|
|
68
|
-
# Tattoo try-on
|
|
68
|
+
# Tattoo try-on — place it with free text...
|
|
69
69
|
client.try_on_tattoo(body_image: body_url, design_image: design_url, placement: "on the right forearm, small")
|
|
70
|
+
# ...or pin the exact spot with a region box (normalized 0-1, from the image's top-left)
|
|
71
|
+
client.try_on_tattoo(body_image: body_url, design_image: design_url, region: { x: 0.32, y: 0.18, w: 0.28, h: 0.34 })
|
|
70
72
|
|
|
71
73
|
# Poll a job manually, or check your credit balance
|
|
72
74
|
status = client.get_status(job_id) # { "status" => ..., "output" => [...], "error" => ... }
|
data/lib/tryiton/client.rb
CHANGED
|
@@ -66,8 +66,14 @@ module Tryiton
|
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
# Ink a design onto skin. Returns the job id.
|
|
69
|
-
# Keys: body_image (required), design_image (required), placement,
|
|
69
|
+
# Keys: body_image (required), design_image (required), placement, region,
|
|
70
70
|
# num_samples (1-4), output_format ("png"/"jpeg").
|
|
71
|
+
#
|
|
72
|
+
# Position the ink two ways, and they compose: +placement+ is free text
|
|
73
|
+
# ("on the right forearm, small"); +region+ pins the exact spot as
|
|
74
|
+
# { x:, y:, w:, h: }, normalized 0-1 from the body image's top-left corner,
|
|
75
|
+
# each side at least 0.06. With a region, +placement+ only describes
|
|
76
|
+
# size/style.
|
|
71
77
|
def try_on_tattoo(**params)
|
|
72
78
|
request(:post, "/tryon/tattoo", params)["jobId"]
|
|
73
79
|
end
|
data/lib/tryiton/version.rb
CHANGED