Lens Turbo: Text to Image
Input a text prompt and select resolution, aspect ratio, and inference steps. Generate a high-quality image using the Lens text-to-image model.
下載工作流程在 Cloud 中試用 API 文件
關於
Input a text prompt and select resolution, aspect ratio, and inference steps. Generate a high-quality image using the Lens text-to-image model.
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程只能在您自己的 ComfyUI 中執行。請下載後將檔案拖放到畫布上。
下載工作流程此工作流程尚無範例輸出。
工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
Loading the graph
Open full-size workflow preview此工作流程中的檔案
- Comfy Cloud
- 否
- 輸出
- 圖片
- 作者
- 作者無法使用
需要自訂節點
- 正在讀取工作流程
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
1 取得 API 金鑰 ↗
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
下載 API JSONAPI 文件 ↗
# 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({
"35": {
"class_type": "ResolutionSelector",
"inputs": {
"aspect_ratio": "1:1 (Square)",
"megapixels": 2,
"multiple": 8
},
"_meta": {
"title": "Resolution Selector"
}
},
"43": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Lens",
"images": [
"34:5",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"34:10": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "lens_turbo_bf16.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"34:14": {
"class_type": "SamplerCustom",
"inputs": {
"add_noise": True,
"cfg": 1,
"latent_image": [
"34:8",
0
],
"model": [
"34:23",
0
],
"negative": [
"34:7",
0
],
"noise_seed": 455122126103069,
"positive": [
"34:3",
0
],
"sampler": [
"34:18",
0
],
"sigmas": [
"34:16",
0
]
},
"_meta": {
"title": "SamplerCustom"
}
},
"34:16": {
"class_type": "BasicScheduler",
"inputs": {
"denoise": 1,
"model": [
"34:21",
0
],
"scheduler": "simple",
"steps": 4
},
"_meta": {
"title": "BasicScheduler"
}
},
"34:18": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"34:2": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "gpt_oss_20b_nvfp4.safetensors",
"device": "default",
"type": "lens"
},
"_meta": {
"title": "Load CLIP"
}
},
"34:21": {
"class_type": "ModelSamplingFlux",
"inputs": {
"base_shift": 0.5,
"height": [
"34:33",
1
],
"max_shift": 1.15,
"model": [
"34:10",
0
],
"width": [
"34:32",
1
]
},
"_meta": {
"title": "ModelSamplingFlux"
}
},
"34:23": {
"class_type": "CFGNorm",
"inputs": {
"model": [
"34:21",
0
],
"pre_cfg": False,
"strength": 1
},
"_meta": {
"title": "CFGNorm"
}
},
"34:3": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"34:2",
0
],
"text": "A stylish vintage Porsche driving through a rainy neon city street at night, reflections shimmering across wet pavement, wide horizontal neon sign displaying \"ComfyUI\", glowing horizontal shop sign reading \"Lens\", cinematic atmosphere, moody retro lighting, analog film grain, 1980s movie still aesthetic"
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"34:30": {
"class_type": "PrimitiveInt",
"inputs": {
"value": [
"35",
0
]
},
"_meta": {
"title": "Int (Width)"
}
},
"34:31": {
"class_type": "PrimitiveInt",
"inputs": {
"value": [
"35",
1
]
},
"_meta": {
"title": "Int (Height)"
}
},
"34:32": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "a & -8",
"values.a": [
"34:30",
0
]
},
"_meta": {
"title": "Math Expression"
}
},
"34:33": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "a & -8",
"values.a": [
"34:31",
0
]
},
"_meta": {
"title": "Math Expression"
}
},
"34:5": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"34:14",
0
],
"vae": [
"34:9",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"34:7": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"34:2",
0
],
"text": ""
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"34:8": {
"class_type": "EmptyLatentImage",
"inputs": {
"batch_size": 1,
"height": [
"34:33",
1
],
"width": [
"34:32",
1
]
},
"_meta": {
"title": "Empty Latent Image"
}
},
"34:9": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "flux2-vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)