Comfy للإعلانات - إنشاء Moodboard
تنزيل سير العملجرّبه في Cloud وثائق API
حول
ما تقدّمه
- جارٍ قراءة سير العمل
يعمل في ComfyUI. لا يمكن تشغيل سير العمل هذا على هذه الصفحة. افتحه في Comfy Cloud مع تحميل كل شيء، أو نزّله لاستخدامه في ComfyUI الخاص بك.
جرّبه في Cloudمثال
جرّب مثالًا
داخل سير العمل
معاينة للقراءة فقط لرسم العقد البياني. افتحه في Comfy Cloud أو نزّله لتعديل العقد.
Loading the graph
Open full-size workflow preview- المؤلف
- ComfyUI
يتطلب عُقدًا مخصصة
- جارٍ قراءة سير العمل
استخدم سير العمل هذا من خلال التعليمات البرمجية
يتم إنشاؤه من مخطط سير العمل والمدخلات عندما يكون ذلك ممكنًا؛ وإلا فتُعرض الأمثلة المخزنة. راجع بيانات الاعتماد ونقاط النهاية قبل تشغيل التعليمات البرمجية، إذ قد تترتب عليها رسوم.
1 الحصول على مفتاح API ↗
What you need
- Runs on
- Comfy Cloud
- المفتاح
- COMFY_API_KEY
يتطلب خطة Cloud مدفوعة ورصيدًا.
تنزيل API JSONوثائق API ↗
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"392": {
"class_type": "RecraftCreateStyleNode",
"inputs": {
"images.image0": [
"420",
0
],
"images.image1": [
"421",
0
],
"images.image2": [
"422",
0
],
"style": "realistic_image"
},
"_meta": {
"title": "Recraft Create Style"
}
},
"395": {
"class_type": "RecraftStyleV3InfiniteStyleLibrary",
"inputs": {
"style_id": [
"392",
0
]
},
"_meta": {
"title": "Recraft - Infinite Style Library"
}
},
"396": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"392",
0
]
},
"_meta": {
"title": "Preview Recraft Style ID"
}
},
"401": {
"class_type": "RecraftTextToImageNode",
"inputs": {
"n": 4,
"negative_prompt": "",
"prompt": "a model wearing street wear with baggy sweater and cargo pants. The sneakers are the hero product. Low angel photography with modern skyscraper",
"recraft_style": [
"395",
0
],
"seed": 983001818549775,
"size": "1024x1024"
},
"_meta": {
"title": "Recraft V3 Text to Image"
}
},
"403": {
"class_type": "OpenAIGPTImage1",
"inputs": {
"background": "auto",
"custom_height": 1024,
"custom_width": 1024,
"image": [
"409",
0
],
"model": "gpt-image-2",
"n": 1,
"prompt": "Take the first two image as style references and use the pair of sneaker as the product reference. Generate a single image of entirely new photography with new talent and background, no texts. Change the background to snowy mountains",
"quality": "medium",
"seed": 1824855344,
"size": "auto"
},
"_meta": {
"title": "OpenAI GPT Image 2"
}
},
"404": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Moodboard_alt",
"images": [
"403",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"405": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Moodboard_var",
"images": [
"401",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"409": {
"class_type": "BatchImagesNode",
"inputs": {
"images.image0": [
"420",
0
],
"images.image1": [
"422",
0
],
"images.image2": [
"425",
0
]
},
"_meta": {
"title": "Batch Images"
}
},
"410": {
"class_type": "RecraftStyleV3InfiniteStyleLibrary",
"inputs": {
"style_id": "02f005e2-50c2-4aa4-bae2-e8ccf0915e6a"
},
"_meta": {
"title": "Recraft - Infinite Style Library (Manual)"
}
},
"420": {
"class_type": "LoadImage",
"inputs": {
"image": "9b8f84040f4cdd20ffa5a5b8dd48cd6939fc6ffffcc3dd4706f2d17e4f968a37.jpg"
},
"_meta": {
"title": "Load Image"
}
},
"421": {
"class_type": "LoadImage",
"inputs": {
"image": "24b6e4662067900ef420d921a62a4d642b513218b0f290b267bb32eaed2a9333.jpg"
},
"_meta": {
"title": "Load Image"
}
},
"422": {
"class_type": "LoadImage",
"inputs": {
"image": "a0d28a9ecaa66d9bb0725142f488ce6343532b4ea42767972975aa4c3f678f79.jpg"
},
"_meta": {
"title": "Load Image"
}
},
"425": {
"class_type": "LoadImage",
"inputs": {
"image": "8ac0fe3f12161e7cc35a346eca40d1962bf477a8ad24239af55d2abfc5ab6ae6.png"
},
"_meta": {
"title": "Load Image"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)