1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "cookie": "insert-your-cookie-here",
10 "generations": [
11 {
12 "prompt": "Combine these to images into a single image in a creative way",
13 "images": [
14 "https://picsum.photos/id/17/800/600",
15 "https://picsum.photos/id/22/800/600",
16 ],
17 "aspectRatio": "16:9",
18 "runs": 1,
19 "name": "combination-01",
20 },
21 {
22 "prompt": "Make the style of the image 10 years older",
23 "images": ["output:combination-01"],
24 "aspectRatio": "1:1",
25 "runs": 2,
26 "name": "older-style",
27 },
28 {
29 "prompt": "Change the style of @img1 using @img2 as reference",
30 "images": [
31 "output:older-style",
32 "upload:1",
33 ],
34 "aspectRatio": "9:16",
35 "runs": 2,
36 },
37 ],
38 "proxyConfiguration": {
39 "useApifyProxy": True,
40 "apifyProxyGroups": ["RESIDENTIAL"],
41 },
42}
43
44
45run = client.actor("igolaizola/freepik-nanobanana").call(run_input=run_input)
46
47
48print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
49for item in client.dataset(run["defaultDatasetId"]).iterate_items():
50 print(item)
51
52