SD3.5大型深度
使用SD 3.5深度資訊引導產生圖像。
關於
此工作流程教你如何用深度圖引導 Stable Diffusion 3.5,讓生成結果尊重參考圖片的結構與透視。它會用 CheckpointLoaderSimple 載入 SD 3.5 Large checkpoint(sd3.5_large_fp8_scaled.safetensors)以及高品質 VAE(vae-ft-mse-840000-ema-pruned.safetensors)。你的文字提示詞會由 CLIPTextEncode 編碼,KSampler 則在 EmptySD3LatentImage 定義的潛空間畫布上進行擴散,因此你可以設定精確的輸出尺寸。VAEDecode、PreviewImage 與 SaveImage 讓你檢視與匯出結果。
深度引導由 ControlNet 提供。ControlNetLoader 載入 sd3.5_large_controlnet_depth.safetensors,ControlNetApplyAdvanced 會把深度條件設定以可調強度與起訖百分比附加到你的提示詞。參考圖片透過 LoadImage 輸入,可選用 ImageScaleToTotalPixels 先調整到接近目標像素數,讓深度圖更貼合輸出尺寸;接著由內建的深度前處理節點(自訂節點 ID:6b0ed7ac-f476-44c9-9dad-b3f23ef985f8)使用 lotus-depth-d-v1-1.safetensors 模型轉成深度圖。對於影像轉影像變體,VAEEncode 可以用參考圖片的潛空間結果作為 KSampler 的起始;若是純文字轉圖像但使用深度引導,則使用 EmptySD3LatentImage。若你想要空的負面提示詞,可使用 ConditioningZeroOut。這個組合能在保留場景布局的同時,讓你用提示詞自由改變風格、光線與細節。
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
# 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({
"4": {
"class_type": "CheckpointLoaderSimple",
"inputs": {
"ckpt_name": "sd3.5_large_fp8_scaled.safetensors"
},
"_meta": {
"title": "Load Checkpoint"
}
},
"8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"56",
0
],
"vae": [
"4",
2
]
},
"_meta": {
"title": "VAE Decode"
}
},
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"33": {
"class_type": "EmptySD3LatentImage",
"inputs": {
"batch_size": 1,
"height": 1024,
"width": 1024
},
"_meta": {
"title": "EmptySD3LatentImage"
}
},
"45": {
"class_type": "LoadImage",
"inputs": {
"image": "sd3.5_large_depth_input_image.png"
},
"_meta": {
"title": "Load Image"
}
},
"46": {
"class_type": "ControlNetLoader",
"inputs": {
"control_net_name": "sd3.5_large_controlnet_depth.safetensors"
},
"_meta": {
"title": "Load ControlNet Model"
}
},
"56": {
"class_type": "KSampler",
"inputs": {
"cfg": 8,
"denoise": 1,
"latent_image": [
"77",
0
],
"model": [
"4",
0
],
"negative": [
"61",
1
],
"positive": [
"61",
0
],
"sampler_name": "euler",
"scheduler": "normal",
"seed": 1020711502084247,
"steps": 20
},
"_meta": {
"title": "KSampler"
}
},
"57": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"4",
1
],
"text": "A cute, plush - like light green baby dragon with large, shiny eyes. It has light yellow horns and wing membranes. Its belly and parts of its wings have a soft, fuzzy texture. The dragon stands against a plain light green background, giving a warm and whimsical feel."
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"58": {
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"57",
0
]
},
"_meta": {
"title": "Conditioning Zero Out"
}
},
"61": {
"class_type": "ControlNetApplyAdvanced",
"inputs": {
"control_net": [
"46",
0
],
"end_percent": 1,
"image": [
"68:99",
0
],
"negative": [
"58",
0
],
"positive": [
"57",
0
],
"start_percent": 0,
"strength": 0.7000000000000002,
"vae": [
"4",
2
]
},
"_meta": {
"title": "Apply ControlNet"
}
},
"70": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"45",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "lanczos"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"73": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"68:99",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"77": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"68:99",
0
],
"vae": [
"4",
2
]
},
"_meta": {
"title": "VAE Encode"
}
},
"68:100": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"68:101": {
"class_type": "SetFirstSigma",
"inputs": {
"sigma": 10000,
"sigmas": [
"68:95",
0
]
},
"_meta": {
"title": "SetFirstSigma"
}
},
"68:87": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "lotus-depth-d-v1-1.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"68:89": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "vae-ft-mse-840000-ema-pruned.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"68:92": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"68:94",
0
],
"latent_image": [
"68:97",
0
],
"noise": [
"68:93",
0
],
"sampler": [
"68:100",
0
],
"sigmas": [
"68:101",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"68:93": {
"class_type": "DisableNoise",
"inputs": {},
"_meta": {
"title": "DisableNoise"
}
},
"68:94": {
"class_type": "BasicGuider",
"inputs": {
"conditioning": [
"68:96",
0
],
"model": [
"68:87",
0
]
},
"_meta": {
"title": "Basic Guider"
}
},
"68:95": {
"class_type": "BasicScheduler",
"inputs": {
"denoise": 1,
"model": [
"68:87",
0
],
"scheduler": "normal",
"steps": 1
},
"_meta": {
"title": "BasicScheduler"
}
},
"68:96": {
"class_type": "LotusConditioning",
"inputs": {},
"_meta": {
"title": "LotusConditioning"
}
},
"68:97": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"70",
0
],
"vae": [
"68:89",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"68:98": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"68:92",
0
],
"vae": [
"68:89",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"68:99": {
"class_type": "ImageInvert",
"inputs": {
"image": [
"68:98",
0
]
},
"_meta": {
"title": "Invert Image Colors"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
是的,深度引導來自參考圖片。請用 LoadImage 載入,讓深度前處理器產生深度圖。若不連接 ControlNet 或將強度設為 0,SD 3.5 仍可運作,但就沒有深度引導效果。
ControlNetApplyAdvanced 中的 ControlNet 強度決定模型遵循深度圖的嚴格程度。去雜訊強度(使用 VAEEncode 做 img2img 時)則控制輸出與初始圖片的整體變化幅度。高 ControlNet 強度可維持結構,較低去雜訊則保留更多原始細節與質感。
請用 EmptySD3LatentImage 設定寬高(或總像素),並將其 LATENT 連到 KSampler。若有參考圖片,建議用 ImageScaleToTotalPixels 先調整圖片大小,讓深度圖比例與輸出解析度相符。
請提高 ControlNet 強度,並確保 ControlNetApplyAdvanced 的 start 設在接近 0.0,讓深度早期生效。可嘗試增加步數或略微提高 cfg。若用 img2img,降低去雜訊強度以保留初始潛變量結構。也請確認深度前處理器的輸出已連到 ControlNetApplyAdvanced。
相關工作流程
- SSD3.5, Stability
SD3.5大型Canny ControlNet
- SSD3.5, Stability
SD3.5大型模糊
- SSD3.5, Stability
SD3.5簡單版
- Flux.2 Dev, Flux.2 Klein, GPT-Image-1.5, Grok, Nano Banana Pro, Qwen-Image-Edit, Seedream
1個輸入與多個編輯模型對比
- AACE-Step
ACE-Step 1.5 音樂產生(4B LLM)
- 合合作夥伴節點
AI on the Lot 2026 - Final WF - t2v
- 合合作夥伴節點
AI on the Lot 2026 - QwenVL - i2t
- 合合作夥伴節點
AI on the Lot 2026 - QwenVL - 提示詞增強器
- 合作夥伴節點
AI on the Lot 2026_LTX-2.3_IC LoRA(Union Control)
- 合合作夥伴節點
Arrow2: Image to SVG
- 合合作夥伴節點
Arrow2: Text to SVG
- ElevenLabs
ElevenLabs:語音轉文字