Comfy의 핵심적인 수치 계산은 모두 파이토치에서 수행됩니다. 사용자 정의 노드를 통해
안정적인 확산의 내부로 들어가려면 이 라이브러리에 익숙해져야 하며, 이는 이번 소개의 범위를 훨씬
넘어서는 내용입니다.그러나 많은 사용자 정의 노드에서는 이미지, 잠재 변수 및 마스크를 조작해야 하며, 이들 각각은 내부적으로
torch.Tensor로 표현됩니다. 따라서
torch.Tensor의 문서를 즐겨찾기 해두시는 것이 좋습니다.
텐서란 무엇인가요?
torch.Tensor는 텐서를 나타내며, 이는 벡터나 행렬을 임의의 차원으로 일반화한 수학적 개념입니다.
텐서의 _랭크_는 가진 차원의 개수를 의미하며(벡터는 랭크 1, 행렬은 랭크 2), _셰이프_는 각 차원의
크기를 설명합니다.예를 들어 RGB 이미지(H 높이, W 너비)는 각 색상 채널별로 H×W 크기의 배열 세 개로 생각할 수 있으며,
이를 셰이프[H,W,3]의 텐서로 표현할 수 있습니다. Comfy에서 이미지는 거의 항상 배치 형태로 제공됩니다(단일
이미지만 포함하는 배치도 포함). torch는 항상 배치 차원을 맨 앞에 두므로 Comfy 이미지는 셰이프[B,H,W,3]를 가지며, 일반적으로 [B,H,W,C]로 표기되며 여기서 C는 채널을 의미합니다.
squeeze, unsqueeze, 그리고 reshape
텐서의 차원 중 하나가 크기가 1인 경우(축소된 차원이라 함), 이는 해당 차원을 제거한 것과 동등합니다(1개의
이미지를 가진 배치는 단순히 이미지임). 이러한 축소된 차원을 제거하는 것을 스queeze라고 하며,
추가하는 것을 unsqueeze라고 합니다.
일부 torch 코드와 일부 사용자 정의 노드 작성자는 차원이 축소되면 스queeze된 텐서를 반환합니다—예를 들어
배치에 구성원이 하나만 있을 때 그렇습니다. 이는 버그의 흔한 원인이 됩니다!
같은 데이터를 다른 형태로 표현하는 것을 reshaping이라고 합니다. 이 과정에서는 종종 기본 데이터 구조를
알아야 하므로 주의해서 다루세요!
중요한 표기법
torch.Tensor는 대부분의 파이썬 슬라이스 표기법, 반복문, 기타 일반적인 리스트와 유사한 연산을 지원합니다. 또한
텐서에는 .shape 속성이 있어 크기를 torch.Size로 반환하며, 이는 tuple의 하위 클래스이며 그대로
취급할 수 있습니다.다른 몇 가지 중요한 표기법도 자주 보게 될 것입니다(이 중 일부는 덜 일반적인 표준 파이썬 표기법이며,
텐서를 다룰 때 훨씬 더 자주 볼 수 있습니다).
torch.Tensor는 슬라이스 표기법에서 None을 사용해 크기가 1인 차원을
삽입하는 것을 지원합니다.
:는 텐서를 슬라이싱할 때 자주 사용되며, 이는 단순히 ‘전체 차원을 유지’한다는 의미입니다.
파이썬에서 a[start:end]를 사용하는 것과 같으나 시작점과 끝점을 생략한 것입니다.
...는 ‘미지정된 차원 전체’를 나타냅니다. 따라서 a[0, ...]는 차원의 개수에 관계없이 배치의 첫 번째
항목을 추출합니다.
모양을 전달해야 하는 메서드에서는 종종 차원들의 tuple로 전달되며,
여기서 단일 차원에 -1을 지정하면 해당 차원의 크기가 데이터 전체 크기에
기반해 계산됨을 나타냅니다.
>>> a = torch.Tensor((1,2))>>> a.shapetorch.Size([2])>>> a[:,None].shape torch.Size([2, 1])>>> a.reshape((1,-1)).shapetorch.Size([1, 2])
요소별 연산
torch.Tensor에서의 많은 이항 연산(예: ’+’, ’-’, ’*’, ’/’, ’==‘)은 요소별로 적용됩니다(각 요소에 독립적으로 적용됨).
피연산자는 둘 다 같은 형태의 텐서이거나, 텐서와 스칼라여야 합니다. 예를 들면:
>>> import torch>>> a = torch.Tensor((1,2))>>> b = torch.Tensor((3,2))>>> a*btensor([3., 4.])>>> a/btensor([0.3333, 1.0000])>>> a==btensor([False, True])>>> a==1tensor([ True, False])>>> c = torch.Tensor((3,2,1)) >>> a==cTraceback (most recent call last): File "<stdin>", line 1, in <module>RuntimeError: The size of tensor a (2) must match the size of tensor b (3) at non-singleton dimension 0
텐서의 참/거짓 값
텐서의 ‘참/거짓 값’은 파이썬 리스트의 그것과 같지 않습니다.
파이썬 리스트의 참/거짓 값은 비어 있지 않은 리스트라면 True, None이나 []라면 False인 것에 익숙하실 겁니다.
반면에 torch.Tensor(하나 이상의 요소를 가진)는 정의된 참/거짓 값을 가지지 않습니다. 대신 .all()이나
.any()를 사용해 요소별 참/거짓 값을 결합해야 합니다:
>>> a = torch.Tensor((1,2))>>> print("yes" if a else "no")Traceback (most recent call last): File "<stdin>", line 1, in <module>RuntimeError: Boolean value of Tensor with more than one value is ambiguous>>> a.all()tensor(False)>>> a.any()tensor(True)
이는 또한 텐서 변수가 설정되었는지 확인하려면 if a:가 아니라 if a is not None:을 사용해야 한다는 것을 의미합니다.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"ComfyUI","colors":{"primary":"#49378B","light":"#F2FF59","dark":"#F2FF59"},"logo":{"light":"https://mintcdn.com/dripart/WCFdTagRdhtvk9-o/logo/light.svg?fit=max\u0026auto=format\u0026n=WCFdTagRdhtvk9-o\u0026q=85\u0026s=ec112de87239058f5a931a7e4b594965","dark":"https://mintcdn.com/dripart/QzWbjSCBG7w61rR3/logo/dark.svg?fit=max\u0026auto=format\u0026n=QzWbjSCBG7w61rR3\u0026q=85\u0026s=62b4d879fb3aadbd7a468d1539032d6f","href":"/"},"favicon":"https://mintcdn.com/dripart/maKDA164-rrTfyxY/favicon.ico?fit=max\u0026auto=format\u0026n=maKDA164-rrTfyxY\u0026q=85\u0026s=94f3a697cf4c9a1ee3961b69219d0942","appearance":{"default":"dark"},"navbar":{"links":[{"href":"https://blog.comfy.org/?utm_source=docs","label":"Blog"},{"href":"/tutorials/partner-nodes/pricing","label":"Pricing"},{"href":"https://platform.comfy.org/?utm_source=docs","label":"Platform"},{"href":"https://comfy.org/download?utm_source=docs","label":"Download"}],"primary":{"type":"button","label":"Comfy Cloud","href":"https://comfy.org/cloud?utm_source=docs"}},"footer":{"socials":{"github":"https://github.com/Comfy-Org/ComfyUI","x":"https://x.com/ComfyUI","discord":"https://discord.com/invite/comfyorg","youtube":"https://www.youtube.com/@comfyorg"},"links":[{"header":"Resources","items":[{"label":"installation","href":"/installation/system_requirements"},{"label":"Tutorials","href":"/tutorials/basic/text-to-image"},{"label":"Development","href":"/development/overview"}]},{"header":"Products","items":[{"label":"Features","href":"https://www.comfy.org/?utm_source=docs"},{"label":"Gallery","href":"https://www.comfy.org/gallery?utm_source=docs"},{"label":"Download","href":"https://www.comfy.org/download?utm_source=docs"}]},{"header":"Company","items":[{"label":"About","href":"https://www.comfy.org/about?utm_source=docs"},{"label":"Careers","href":"https://www.comfy.org/careers?utm_source=docs"},{"label":"Terms of Service","href":"https://www.comfy.org/terms-of-service?utm_source=docs"},{"label":"Privacy Policy","href":"https://www.comfy.org/privacy-policy?utm_source=docs"}]}]},"search":{"prompt":"Search Comfy documentation..."},"seo":{"metatags":{"googlebot":"max-video-preview:0"}},"icons":{"library":"fontawesome"},"integrations":{"ga4":{"measurementId":"G-MXC01ZDDHQ"},"posthog":{"apiKey":"phc_iKfK86id4xVYws9LybMje0h44eGtfwFgRPIBehmy8rO"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"languages":[{"language":"en","href":""},{"language":"zh","footer":{"socials":{"github":"https://github.com/Comfy-Org/ComfyUI","x":"https://x.com/ComfyUI","discord":"https://discord.com/invite/comfyorg","youtube":"https://www.youtube.com/@comfyorg"},"links":[{"header":"资源","items":[{"label":"安装","href":"/zh/installation/system_requirements"},{"label":"教程","href":"/zh/tutorials/basic/text-to-image"},{"label":"开发","href":"/zh/development/overview"}]},{"header":"产品","items":[{"label":"功能","href":"https://www.comfy.org/?utm_source=docs"},{"label":"画廊","href":"https://www.comfy.org/gallery?utm_source=docs"},{"label":"下载","href":"https://www.comfy.org/download?utm_source=docs"}]},{"header":"公司","items":[{"label":"关于","href":"https://www.comfy.org/about?utm_source=docs"},{"label":"招聘","href":"https://www.comfy.org/careers?utm_source=docs"},{"label":"服务条款","href":"https://www.comfy.org/terms-of-service?utm_source=docs"},{"label":"隐私政策","href":"https://www.comfy.org/privacy-policy?utm_source=docs"}]}]},"href":"zh"},{"language":"ja","footer":{"socials":{"github":"https://github.com/Comfy-Org/ComfyUI","x":"https://x.com/ComfyUI","discord":"https://discord.com/invite/comfyorg","youtube":"https://www.youtube.com/@comfyorg"},"links":[{"header":"リソース","items":[{"label":"インストール","href":"/ja/installation/system_requirements"},{"label":"チュートリアル","href":"/ja/tutorials/basic/text-to-image"},{"label":"開発","href":"/ja/development/overview"}]},{"header":"プロダクト","items":[{"label":"機能","href":"https://www.comfy.org/?utm_source=docs"},{"label":"ギャラリー","href":"https://www.comfy.org/gallery?utm_source=docs"},{"label":"ダウンロード","href":"https://www.comfy.org/download?utm_source=docs"}]},{"header":"会社情報","items":[{"label":"概要","href":"https://www.comfy.org/about?utm_source=docs"},{"label":"採用情報","href":"https://www.comfy.org/careers?utm_source=docs"},{"label":"利用規約","href":"https://www.comfy.org/terms-of-service?utm_source=docs"},{"label":"プライバシーポリシー","href":"https://www.comfy.org/privacy-policy?utm_source=docs"}]}]},"navbar":{"links":[{"href":"/ja/tutorials/partner-nodes/pricing","label":"料金"},{"href":"https://comfy.org/download?utm_source=docs","label":"ダウンロード"}],"primary":{"type":"button","label":"Comfy Cloud","href":"https://comfy.org/cloud?utm_source=docs"}},"href":"ja"},{"language":"ko","footer":{"socials":{"github":"https://github.com/Comfy-Org/ComfyUI","x":"https://x.com/ComfyUI","discord":"https://discord.com/invite/comfyorg","youtube":"https://www.youtube.com/@comfyorg"},"links":[{"header":"리소스","items":[{"label":"설치","href":"/ko/installation/system_requirements"},{"label":"튜토리얼","href":"/ko/tutorials/basic/text-to-image"},{"label":"개발","href":"/ko/development/overview"}]},{"header":"제품","items":[{"label":"기능","href":"https://www.comfy.org/?utm_source=docs"},{"label":"갤러리","href":"https://www.comfy.org/gallery?utm_source=docs"},{"label":"다운로드","href":"https://www.comfy.org/download?utm_source=docs"}]},{"header":"회사 정보","items":[{"label":"소개","href":"https://www.comfy.org/about?utm_source=docs"},{"label":"채용","href":"https://www.comfy.org/careers?utm_source=docs"},{"label":"이용약관","href":"https://www.comfy.org/terms-of-service?utm_source=docs"},{"label":"개인정보 처리방침","href":"https://www.comfy.org/privacy-policy?utm_source=docs"}]}]},"navbar":{"links":[{"href":"/ko/tutorials/partner-nodes/pricing","label":"가격 정책"},{"href":"https://comfy.org/download?utm_source=docs","label":"다운로드"}],"primary":{"type":"button","label":"Comfy Cloud","href":"https://comfy.org/cloud?utm_source=docs"}},"href":"ko"},{"language":"es","href":"es"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"dripart","hasAudioNarration":false,"actualSubdomain":"dripart","customDomains":["docs.comfy.org"],"gitSource":{"type":"github","owner":"comfy-org","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true,"issues":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6afce70e4773d7786faf5db4","clientVersion":"0.0.4177","searchFilterCounts":[{"language":"en","tag":"Built-in Nodes","count":1185},{"language":"ja","tag":"組み込みノード","count":1185},{"language":"zh","tag":"内置节点","count":1185},{"language":"en","tag":"Nodes","count":1184},{"language":"ja","tag":"ノード","count":1184},{"language":"zh","tag":"节点","count":1184},{"language":"ko","tag":"내장 노드 (Built-in Nodes)","count":1143},{"language":"ko","tag":"노드","count":1142},{"language":"es","tag":"Nodos integrados","count":1077},{"language":"es","tag":"Nodos","count":1076},{"language":"en","tag":"Tutorials","count":428},{"language":"es","tag":"Tutoriales","count":428},{"language":"en","tag":"Model","count":382},{"language":"ja","tag":"Model","count":382},{"language":"ko","tag":"Model","count":382},{"language":"zh","tag":"Model","count":382},{"language":"es","tag":"Modelo","count":378},{"language":"en","tag":"Image","count":362},{"language":"en","tag":"Partner","count":359},{"language":"ja","tag":"Partner","count":359},{"language":"ko","tag":"Partner","count":359},{"language":"zh","tag":"Partner","count":359},{"language":"es","tag":"Partner","count":357},{"language":"ja","tag":"はじめに","count":350},{"language":"ko","tag":"시작하기","count":350},{"language":"zh","tag":"开始使用","count":350},{"language":"ja","tag":"API 開発","count":341},{"language":"ko","tag":"API 개발","count":341},{"language":"zh","tag":"API 开发","count":341},{"language":"es","tag":"Imagen","count":331},{"language":"es","tag":"Comfy Router","count":312},{"language":"en","tag":"Comfy Router","count":303},{"language":"ja","tag":"Comfy Router","count":303},{"language":"ko","tag":"Comfy Router","count":303},{"language":"zh","tag":"Comfy Router","count":303},{"language":"en","tag":"Video","count":298},{"language":"en","tag":"Models","count":273},{"language":"es","tag":"Video","count":273},{"language":"es","tag":"Models","count":273},{"language":"ja","tag":"Models","count":273},{"language":"ko","tag":"Models","count":273},{"language":"zh","tag":"Models","count":273},{"language":"en","tag":"All Models","count":270},{"language":"es","tag":"All Models","count":270},{"language":"ja","tag":"画像","count":219},{"language":"ko","tag":"이미지","count":219},{"language":"zh","tag":"图像","count":219},{"language":"ja","tag":"Video","count":198},{"language":"zh","tag":"Video","count":198},{"language":"ko","tag":"Video","count":181}],"searchSettings":{"maxResults":10}},"assistantConfig":{"enableStarterQuestions":false},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":":root{--ink-900: #151417;--hub-shell-light: #f7f6f9;--accent-purple: #49378b;--accent-yellow: #f2ff59;--primary: 73 55 139 !important;--primary-light: 242 255 89 !important;--primary-dark: 242 255 89 !important}html.dark{--primary: 242 255 89 !important;--background-dark: 14 14 13 !important}html.dark body{background-color:#0e0e0d!important}html.dark #navbar,html.dark #navbar-transition{background-color:var(--ink-900)!important}html.dark #sidebar,html.dark #sidebar-content{background-color:rgb(var(--background-dark))!important}html.dark #navbar,html.dark #navbar-transition{box-shadow:none!important;filter:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}html.dark #navbar-transition{border-bottom:1px solid rgba(255, 255, 255, 0.08)!important;opacity:1!important}html.dark img.nav-logo{filter:none}html.dark #sidebar-content a:not([aria-current=\"page\"]){color:rgba(255, 255, 255, 0.72)!important}html.dark #sidebar-content a:not([aria-current=\"page\"]) *{color:inherit!important}html.dark #sidebar-content a[aria-current=\"page\"]{color:var(--accent-yellow)!important;background-color:rgba(242, 255, 89, 0.10)!important}html.dark #sidebar-content a[aria-current=\"page\"] *{color:inherit!important}html.dark .nav-tabs-item[data-active],html.dark mobile-nav-tabs-item[data-active]{color:var(--accent-yellow)!important}html.dark #navbar a[href*=\"comfy.org/cloud\"] span.absolute{background-color:var(--accent-yellow)!important}html.dark #navbar a[href*=\"comfy.org/cloud\"] span.text-white{color:#151417!important}html:not(.dark) #background-color,html:not(.dark) #navbar,html:not(.dark) #navbar-transition,html:not(.dark) #sidebar,html:not(.dark) #sidebar-content{background-color:var(--hub-shell-light)!important}html:not(.dark) .nav-tabs-item[data-active],html:not(.dark) mobile-nav-tabs-item[data-active],html:not(.dark) nav-dropdown-item[data-active]{background-color:transparent!important;box-shadow:none!important;color:var(--accent-purple)!important;font-weight:600!important}html:not(.dark) .nav-tabs-item[data-active] *,html:not(.dark) mobile-nav-tabs-item[data-active] *,html:not(.dark) nav-dropdown-item[data-active] *{color:inherit!important}html:not(.dark) #sidebar-content li:has(>a[aria-current=\"page\"]){background-color:transparent!important;box-shadow:none!important}html:not(.dark) #sidebar-content a[aria-current=\"page\"]{color:var(--accent-purple)!important;background-color:rgba(73, 55, 139, 0.1)!important;font-weight:600!important}html:not(.dark) #sidebar-content a[aria-current=\"page\"] *{color:inherit!important}html:not(.dark) toc-item[data-active],html:not(.dark) toc-item[data-active-deepest],html:not(.dark) toc-item[data-active] a,html:not(.dark) toc-item[data-active-deepest] a{background-color:transparent!important;color:var(--accent-purple)!important;font-weight:600!important}html:not(.dark) #header :where(h1,h2,h3,h4,h5,h6),html:not(.dark) #content-area :where(h1,h2,h3,h4,h5,h6){color:#151417!important}html:not(.dark) #navbar a[href*=\"comfy.org/cloud\"]{background-color:transparent!important;color:var(--accent-purple)!important;border-radius:0.75rem;box-shadow:inset 0 0 0 1px var(--accent-purple)!important}html:not(.dark) #navbar a[href*=\"comfy.org/cloud\"] span.absolute{background-color:transparent!important}html:not(.dark) #navbar a[href*=\"comfy.org/cloud\"] *{color:inherit!important}#sidebar .sticky.top-0.pointer-events-none.bg-linear-to-b{background-image:none!important}@media (min-width: 1024px){#navbar.is-not-custom.is-not-center+div:has(>#sidebar),.max-w-8xl.mx-auto.relative,.max-w-8xl.mx-auto{max-width:none!important;width:100%!important;margin-left:0!important;margin-right:0!important;padding-left:0!important;padding-right:0!important}#navbar [class*=\"px-12\"],#navbar [class*=\"mx-4\"]{padding-left:0!important;padding-right:1.5rem!important;margin-left:0!important;margin-right:0!important}#navbar a.select-none,#navbar .nav-logo{margin-left:1rem!important}#navbar .nav-tabs{padding-left:2rem!important}#sidebar{left:0!important;margin-left:0!important;box-shadow:none!important}#sidebar-content{margin-left:0!important;padding-left:1rem!important;box-sizing:border-box!important}#navbar,#navbar-transition{left:0!important;right:0!important;width:100%!important;max-width:none!important}#content-area{margin-left:0!important;max-width:none!important;width:100%!important;padding-left:18rem!important}#sidebar.sticky~#content-container #content-area{padding-left:2rem!important;padding-right:2rem!important}#content-container,#body-content{max-width:none!important;width:100%!important}:root{--content-width: 100%;--sidebar-width: 18rem}}@media (min-width: 1024px){nav#sidebar,#sidebar[style]{left:0!important;right:auto!important;margin-left:0!important;transform:none!important}#navbar li.navbar-link:has(a[href*=\"comfy.org/download\"]){margin-right:0!important}#navbar a[href*=\"comfy.org/download\"]{box-sizing:border-box;border:1px solid rgb(255 255 255 / 0.22);border-radius:0.75rem;padding:7px 0.875rem!important;color:#fff!important;font-size:0.875rem;line-height:1.25rem}html:not(.dark) #navbar a[href*=\"comfy.org/download\"]{border-color:rgb(0 0 0 / 0.16);color:#151417!important}#navbar a[href*=\"comfy.org/download\"]:hover{background:rgb(255 255 255 / 0.06)}html:not(.dark) #navbar a[href*=\"comfy.org/download\"]:hover{background:rgb(0 0 0 / 0.04)}#navbar li.navbar-link:has(a[href*=\"comfy.org/download\"])+.whitespace-nowrap,#navbar .flex.space-x-6>.whitespace-nowrap.hidden{margin-left:0.5rem!important}}body:has(.router-api-reference-marker) #content,body:has(.router-api-reference-marker) #header{max-width:48rem}body:has(.router-api-reference-marker) #content-area table{width:100%;table-layout:auto}body:has(.router-api-reference-marker) #content-area th,body:has(.router-api-reference-marker) #content-area td{min-width:4rem!important;overflow-wrap:anywhere}body:has(.router-api-reference-marker) #content-area table:has(th:nth-child(6)) th:nth-child(3),body:has(.router-api-reference-marker) #content-area table:has(th:nth-child(6)) td:nth-child(3){min-width:5rem!important}@media (max-width: 1535px){body:has(.router-api-reference-marker) #content-side-layout{display:none!important}}body:has(.router-provider-coverage-marker) #content,body:has(.router-provider-coverage-marker) #header{max-width:64rem}body:has(.router-provider-coverage-marker) #content-area table{width:100%;table-layout:auto}body:has(.router-provider-coverage-marker) #content-area th,body:has(.router-provider-coverage-marker) #content-area td{min-width:5rem!important;overflow-wrap:anywhere}body:has(.router-provider-coverage-marker) #content-area th:first-child,body:has(.router-provider-coverage-marker) #content-area td:first-child{min-width:12rem!important}body:has(.router-quickstart-marker) [data-component-part=\"card-content\"] [data-component-part=\"code-block-root\"][style*=\"height:190px\"],body:has(.router-quickstart-marker) [data-component-part=\"card-content\"] [data-component-part=\"code-block-root\"][style*=\"height: 190px\"]{height:86px!important}"},{"filePath":"samples-cards.css","content":".sample-card-grid{display:grid;gap:20px;grid-template-columns:repeat(2, minmax(0, 1fr));margin-top:28px}.sample-card{min-width:0;perspective:1200px}.sample-card-inner{height:565px;position:relative;transform-style:preserve-3d;transition:transform 560ms cubic-bezier(.2, .75, .3, 1)}.sample-card[data-flipped=\"true\"] .sample-card-inner{transform:rotateY(180deg)}.sample-card-face{backface-visibility:hidden;background:#fff;border:1px solid #e5e1eb;border-radius:12px;box-sizing:border-box;height:100%;inset:0;overflow:hidden;position:absolute;width:100%}.sample-card-front{display:flex;flex-direction:column}.sample-card-back{opacity:0;pointer-events:none;transform:rotateY(180deg);visibility:hidden}.sample-card[data-flipped=\"true\"] .sample-card-front{pointer-events:none;transition:visibility 0s linear 280ms;visibility:hidden}.sample-card[data-flipped=\"true\"][data-active-path=\"api\"] .sample-card-back[data-sample-path=\"api\"],.sample-card[data-flipped=\"true\"][data-active-path=\"endpoint\"] .sample-card-back[data-sample-path=\"endpoint\"]{opacity:1;pointer-events:auto;visibility:visible}.sample-card-preview{border-bottom:1px solid #e5e1eb;cursor:pointer;display:block;width:100%}.sample-card-body{display:flex;flex:1;flex-direction:column;padding:20px}.sample-card-body h2,.sample-path-body h2{color:#49378b;font-size:18px;font-weight:700;letter-spacing:-.02em;margin:0 0 8px}.sample-path-body h2{text-align:center}.sample-card-body>p{color:#5f5966;font-size:14px;line-height:1.55;margin:0;min-height:66px}.sample-card-actions{display:flex;gap:8px;margin-top:20px}.sample-card-actions button{background:#fff;border:1px solid #cfc8de;border-radius:6px;color:#49378b;cursor:pointer;flex:1;font-size:13px;font-weight:700;padding:10px 12px}.sample-card-links{border-top:1px solid #eeeaf1;display:flex;gap:8px;margin-top:16px;padding-top:12px}.sample-card-links a{color:#625b6c;font-size:12px;font-weight:650;text-decoration:none}.sample-card-links span{color:#b3adba}.sample-path-body{padding:20px}.sample-path-body>button{background:transparent;border:0;color:#625b6c;cursor:pointer;font-size:12px;font-weight:700;padding:0}.sample-path-eyebrow{color:#857a9e;font-size:10px;font-weight:700;letter-spacing:.08em;margin:19px 0 5px;text-align:center;text-transform:uppercase}.sample-path-body>p:not(.sample-path-eyebrow){color:#5f5966;font-size:12px;line-height:1.5;margin:0 0 15px}.sample-path-steps{display:grid;gap:8px}.sample-path-step{align-items:center;background:#faf9fc;border:1px solid #e5e1ea;border-radius:8px;display:flex;gap:10px;padding:10px 11px}.sample-path-number{align-items:center;background:#49378b;border-radius:999px;color:#fff;display:inline-flex;flex:0 0 21px;font-size:11px;font-weight:700;height:21px;justify-content:center}.sample-path-copy{flex:1;min-width:0}.sample-path-copy strong{color:#312c36;display:block;font-size:12px}.sample-path-copy span{color:#706a75;display:block;font-size:11px;line-height:1.35;margin-top:2px}.sample-path-step a{color:#49378b;flex:0 0 auto;font-size:11px;font-weight:700;text-decoration:none}@media (max-width: 768px){.sample-card-grid{grid-template-columns:1fr}.sample-card-inner{height:clamp(620px, 180vw, 760px)}}"}],"page":{"pagePath":"ko/custom-nodes/backend/tensors","slug":"/ko/custom-nodes/backend/tensors","pageMetadata":{"title":"torch.Tensor와 함께 작업하기","sidebarTitle":"텐서","description":"ComfyUI 커스텀 노드에 필요한 torch.Tensor 기초: 텐서 형태, squeeze/unsqueeze, 표기법, 요소별 연산, 텐서 진리값.","translationSourceHash":"56247ba0","translationFrom":"custom-nodes/backend/tensors.mdx","href":"/ko/custom-nodes/backend/tensors"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"ComfyUI 커스텀 노드에 필요한 torch.Tensor 기초: 텐서 형태, squeeze/unsqueeze, 표기법, 요소별 연산, 텐서 진리값.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`파이토치-텐서-그리고-torch-tensor`,children:`파이토치, 텐서, 그리고 torch.Tensor`}),`\n`,_jsxs(_components.p,{children:[`Comfy의 핵심적인 수치 계산은 모두 `,_jsx(_components.a,{href:`https://pytorch.org/`,children:`파이토치`}),`에서 수행됩니다. 사용자 정의 노드를 통해\n안정적인 확산의 내부로 들어가려면 이 라이브러리에 익숙해져야 하며, 이는 이번 소개의 범위를 훨씬\n넘어서는 내용입니다.`]}),`\n`,_jsxs(_components.p,{children:[`그러나 많은 사용자 정의 노드에서는 이미지, 잠재 변수 및 마스크를 조작해야 하며, 이들 각각은 내부적으로\n`,_jsx(_components.code,{children:`torch.Tensor`}),`로 표현됩니다. 따라서\n`,_jsx(_components.a,{href:`https://pytorch.org/docs/stable/tensors.html`,children:`torch.Tensor의 문서`}),`를 즐겨찾기 해두시는 것이 좋습니다.`]}),`\n`,_jsx(Heading,{level:`3`,id:`텐서란-무엇인가요`,children:`텐서란 무엇인가요?`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`torch.Tensor`}),`는 텐서를 나타내며, 이는 벡터나 행렬을 임의의 차원으로 일반화한 수학적 개념입니다.\n텐서의 _랭크_는 가진 차원의 개수를 의미하며(벡터는 `,_jsx(_components.em,{children:`랭크`}),` 1, 행렬은 `,_jsx(_components.em,{children:`랭크`}),` 2), _셰이프_는 각 차원의\n크기를 설명합니다.`]}),`\n`,_jsxs(_components.p,{children:[`예를 들어 RGB 이미지(H 높이, W 너비)는 각 색상 채널별로 H×W 크기의 배열 세 개로 생각할 수 있으며,\n이를 `,_jsx(_components.em,{children:`셰이프`}),` `,_jsx(_components.code,{children:`[H,W,3]`}),`의 텐서로 표현할 수 있습니다. Comfy에서 이미지는 거의 항상 배치 형태로 제공됩니다(단일\n이미지만 포함하는 배치도 포함). torch는 항상 배치 차원을 맨 앞에 두므로 Comfy 이미지는 `,_jsx(_components.em,{children:`셰이프`}),`\n`,_jsx(_components.code,{children:`[B,H,W,3]`}),`를 가지며, 일반적으로 `,_jsx(_components.code,{children:`[B,H,W,C]`}),`로 표기되며 여기서 C는 채널을 의미합니다.`]}),`\n`,_jsx(Heading,{level:`3`,id:`squeeze-unsqueeze-그리고-reshape`,children:`squeeze, unsqueeze, 그리고 reshape`}),`\n`,_jsx(_components.p,{children:`텐서의 차원 중 하나가 크기가 1인 경우(축소된 차원이라 함), 이는 해당 차원을 제거한 것과 동등합니다(1개의\n이미지를 가진 배치는 단순히 이미지임). 이러한 축소된 차원을 제거하는 것을 스queeze라고 하며,\n추가하는 것을 unsqueeze라고 합니다.`}),`\n`,_jsx(Warning,{children:` 일부 torch 코드와 일부 사용자 정의 노드 작성자는 차원이 축소되면 스queeze된 텐서를 반환합니다—예를 들어\n배치에 구성원이 하나만 있을 때 그렇습니다. 이는 버그의 흔한 원인이 됩니다!`}),`\n`,_jsx(_components.p,{children:`같은 데이터를 다른 형태로 표현하는 것을 reshaping이라고 합니다. 이 과정에서는 종종 기본 데이터 구조를\n알아야 하므로 주의해서 다루세요!`}),`\n`,_jsx(Heading,{level:`3`,id:`중요한-표기법`,children:`중요한 표기법`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`torch.Tensor`}),`는 대부분의 파이썬 슬라이스 표기법, 반복문, 기타 일반적인 리스트와 유사한 연산을 지원합니다. 또한\n텐서에는 `,_jsx(_components.code,{children:`.shape`}),` 속성이 있어 크기를 `,_jsx(_components.code,{children:`torch.Size`}),`로 반환하며, 이는 `,_jsx(_components.code,{children:`tuple`}),`의 하위 클래스이며 그대로\n취급할 수 있습니다.`]}),`\n`,_jsx(_components.p,{children:`다른 몇 가지 중요한 표기법도 자주 보게 될 것입니다(이 중 일부는 덜 일반적인 표준 파이썬 표기법이며,\n텐서를 다룰 때 훨씬 더 자주 볼 수 있습니다).`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`torch.Tensor`}),`는 슬라이스 표기법에서 `,_jsx(_components.code,{children:`None`}),`을 사용해 크기가 1인 차원을\n삽입하는 것을 지원합니다.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`:`}),`는 텐서를 슬라이싱할 때 자주 사용되며, 이는 단순히 ‘전체 차원을 유지’한다는 의미입니다.\n파이썬에서 `,_jsx(_components.code,{children:`a[start:end]`}),`를 사용하는 것과 같으나 시작점과 끝점을 생략한 것입니다.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`...`}),`는 ‘미지정된 차원 전체’를 나타냅니다. 따라서 `,_jsx(_components.code,{children:`a[0, ...]`}),`는 차원의 개수에 관계없이 배치의 첫 번째\n항목을 추출합니다.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`모양을 전달해야 하는 메서드에서는 종종 차원들의 `,_jsx(_components.code,{children:`tuple`}),`로 전달되며,\n여기서 단일 차원에 `,_jsx(_components.code,{children:`-1`}),`을 지정하면 해당 차원의 크기가 데이터 전체 크기에\n기반해 계산됨을 나타냅니다.`]}),`\n`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` torch.Tensor((`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a.shape`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`torch.Size([`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a[:,`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].shape `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`torch.Size([`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a.reshape((`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)).shape`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`torch.Size([`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`요소별-연산`,children:`요소별 연산`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`torch.Tensor`}),`에서의 많은 이항 연산(예: ’+’, ’-’, ’*’, ’/’, ’==‘)은 요소별로 적용됩니다(각 요소에 독립적으로 적용됨).\n피연산자는 `,_jsx(_components.em,{children:`둘 다`}),` 같은 형태의 텐서이거나, 텐서와 스칼라여야 합니다. 예를 들면:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` torch`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` torch.Tensor((`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` b `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` torch.Tensor((`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`b`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`tensor([`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`., `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`b`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`tensor([`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.3333`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1.0000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`b`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`tensor([`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`tensor([ `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` c `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` torch.Tensor((`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`c`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`Traceback (most recent call last):`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` File `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cstdin>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, line `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`in`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`module`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`RuntimeError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: The size of tensor a (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) must match the size of tensor b (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) at non`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`singleton dimension `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`텐서의-참/거짓-값`,children:`텐서의 참/거짓 값`}),`\n`,_jsx(Warning,{children:` 텐서의 ‘참/거짓 값’은 파이썬 리스트의 그것과 같지 않습니다.`}),`\n`,_jsxs(_components.p,{children:[`파이썬 리스트의 참/거짓 값은 비어 있지 않은 리스트라면 `,_jsx(_components.code,{children:`True`}),`, `,_jsx(_components.code,{children:`None`}),`이나 `,_jsx(_components.code,{children:`[]`}),`라면 `,_jsx(_components.code,{children:`False`}),`인 것에 익숙하실 겁니다.\n반면에 `,_jsx(_components.code,{children:`torch.Tensor`}),`(하나 이상의 요소를 가진)는 정의된 참/거짓 값을 가지지 않습니다. 대신 `,_jsx(_components.code,{children:`.all()`}),`이나\n`,_jsx(_components.code,{children:`.any()`}),`를 사용해 요소별 참/거짓 값을 결합해야 합니다:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` torch.Tensor((`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"yes\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"no\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`Traceback (most recent call last):`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` File `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cstdin>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, line `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`in`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`module`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`RuntimeError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: Boolean value of Tensor `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` more than one value `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`is`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ambiguous`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a.all()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`tensor(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>>>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a.any()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`tensor(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`이는 또한 텐서 변수가 설정되었는지 확인하려면 `,_jsx(_components.code,{children:`if a:`}),`가 아니라 `,_jsx(_components.code,{children:`if a is not None:`}),`을 사용해야 한다는 것을 의미합니다.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"torch.Tensor와 함께 작업하기","sidebarTitle":"텐서","description":"ComfyUI 커스텀 노드에 필요한 torch.Tensor 기초: 텐서 형태, squeeze/unsqueeze, 표기법, 요소별 연산, 텐서 진리값.","translationSourceHash":"56247ba0","translationFrom":"custom-nodes/backend/tensors.mdx","href":"/ko/custom-nodes/backend/tensors"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"파이토치, 텐서, 그리고 torch.Tensor","slug":"파이토치-텐서-그리고-torch-tensor","depth":2,"children":[{"title":"텐서란 무엇인가요?","slug":"텐서란-무엇인가요","depth":3,"children":[]},{"title":"squeeze, unsqueeze, 그리고 reshape","slug":"squeeze-unsqueeze-그리고-reshape","depth":3,"children":[]},{"title":"중요한 표기법","slug":"중요한-표기법","depth":3,"children":[]},{"title":"요소별 연산","slug":"요소별-연산","depth":3,"children":[]},{"title":"텐서의 참/거짓 값","slug":"텐서의-참/거짓-값","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/dripart/9d6bf2b2531e904c/giscus-comments.js","/_mintlify/custom/dripart/bd0341946f3c75a6/syft.js","/_mintlify/custom/dripart/042392a43b5e681e/samples-cards.js"],"dynamicCss":".\\[start\\:end\\] {\n start: end\n}","subdomain":"dripart","siteName":"ComfyUI","title":"torch.Tensor와 함께 작업하기 - ComfyUI","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/custom-nodes/backend/tensors","matchLevel":1},"zh":{"href":"/zh/custom-nodes/backend/tensors","matchLevel":1},"ja":{"href":"/ja/custom-nodes/backend/tensors","matchLevel":1},"ko":{"href":"/ko/custom-nodes/backend/tensors","matchLevel":0},"es":{"href":"/es/custom-nodes/backend/tensors","matchLevel":1}}},"lastModified":"2026-11-13T14:01:31.407Z","originalFileLocation":"ko/custom-nodes/backend/tensors.mdx","locale":"ko"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"ComfyUI 커스텀 노드에 필요한 torch.Tensor 기초: 텐서 형태, squeeze/unsqueeze, 표기법, 요소별 연산, 텐서 진리값.\">\u003cmeta data-mint-head name=\"application-name\" content=\"ComfyUI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dripart/lS3H5I41bE6LSXEf/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/dripart/lS3H5I41bE6LSXEf/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dripart/lS3H5I41bE6LSXEf/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dripart/lS3H5I41bE6LSXEf/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dripart/lS3H5I41bE6LSXEf/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dripart/lS3H5I41bE6LSXEf/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dripart/lS3H5I41bE6LSXEf/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dripart/lS3H5I41bE6LSXEf/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dripart/lS3H5I41bE6LSXEf/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"torch.Tensor와 함께 작업하기 - ComfyUI\">\u003cmeta data-mint-head property=\"og:description\" content=\"ComfyUI 커스텀 노드에 필요한 torch.Tensor 기초: 텐서 형태, squeeze/unsqueeze, 표기법, 요소별 연산, 텐서 진리값.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ComfyUI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.comfy.org/ko/custom-nodes/backend/tensors\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://dripart.mintlify.site/_mintlify/api/og/v2?division=Python+%28%EB%B0%B1%EC%97%94%EB%93%9C%29\u0026amp;title=torch.Tensor%EC%99%80+%ED%95%A8%EA%BB%98+%EC%9E%91%EC%97%85%ED%95%98%EA%B8%B0\u0026amp;description=ComfyUI+%EC%BB%A4%EC%8A%A4%ED%85%80+%EB%85%B8%EB%93%9C%EC%97%90+%ED%95%84%EC%9A%94%ED%95%9C+torch.Tensor+%EA%B8%B0%EC%B4%88%3A+%ED%85%90%EC%84%9C+%ED%98%95%ED%83%9C%2C+squeeze%2Funsqueeze%2C+%ED%91%9C%EA%B8%B0%EB%B2%95%2C+%EC%9A%94%EC%86%8C%EB%B3%84+%EC%97%B0%EC%82%B0%2C+%ED%85%90%EC%84%9C+%EC%A7%84%EB%A6%AC%EA%B0%92.\u0026amp;theme=b252c39adf72ba65053766a0\u0026amp;signature=a901d64b2f049546540c6210fea1491af79503610dc5fdf75325dc8ae6dbf201\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"torch.Tensor와 함께 작업하기 - ComfyUI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"ComfyUI 커스텀 노드에 필요한 torch.Tensor 기초: 텐서 형태, squeeze/unsqueeze, 표기법, 요소별 연산, 텐서 진리값.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dripart.mintlify.site/_mintlify/api/og/v2?division=Python+%28%EB%B0%B1%EC%97%94%EB%93%9C%29\u0026amp;title=torch.Tensor%EC%99%80+%ED%95%A8%EA%BB%98+%EC%9E%91%EC%97%85%ED%95%98%EA%B8%B0\u0026amp;description=ComfyUI+%EC%BB%A4%EC%8A%A4%ED%85%80+%EB%85%B8%EB%93%9C%EC%97%90+%ED%95%84%EC%9A%94%ED%95%9C+torch.Tensor+%EA%B8%B0%EC%B4%88%3A+%ED%85%90%EC%84%9C+%ED%98%95%ED%83%9C%2C+squeeze%2Funsqueeze%2C+%ED%91%9C%EA%B8%B0%EB%B2%95%2C+%EC%9A%94%EC%86%8C%EB%B3%84+%EC%97%B0%EC%82%B0%2C+%ED%85%90%EC%84%9C+%EC%A7%84%EB%A6%AC%EA%B0%92.\u0026amp;theme=b252c39adf72ba65053766a0\u0026amp;signature=a901d64b2f049546540c6210fea1491af79503610dc5fdf75325dc8ae6dbf201\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/dripart/lS3H5I41bE6LSXEf/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ComfyUI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#49378B\">\u003cmeta data-mint-head name=\"googlebot\" content=\"max-video-preview:0\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.comfy.org/ko/custom-nodes/backend/tensors\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/ko/custom-nodes/backend/tensors.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://docs.comfy.org/ko/custom-nodes/backend/tensors\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.comfy.org/custom-nodes/backend/tensors\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.comfy.org/zh/custom-nodes/backend/tensors\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.comfy.org/ja/custom-nodes/backend/tensors\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://docs.comfy.org/es/custom-nodes/backend/tensors\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.comfy.org/custom-nodes/backend/tensors\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.comfy.org/#organization\",\"name\":\"ComfyUI\",\"url\":\"https://docs.comfy.org\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/dripart/WCFdTagRdhtvk9-o/logo/light.svg?fit=max\u0026auto=format\u0026n=WCFdTagRdhtvk9-o\u0026q=85\u0026s=ec112de87239058f5a931a7e4b594965\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.comfy.org#website\",\"name\":\"ComfyUI\",\"url\":\"https://docs.comfy.org\",\"publisher\":{\"@id\":\"https://docs.comfy.org/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.comfy.org/ko/custom-nodes/backend/tensors#webpage\",\"url\":\"https://docs.comfy.org/ko/custom-nodes/backend/tensors\",\"name\":\"torch.Tensor와 함께 작업하기\",\"description\":\"ComfyUI 커스텀 노드에 필요한 torch.Tensor 기초: 텐서 형태, squeeze/unsqueeze, 표기법, 요소별 연산, 텐서 진리값.\",\"dateModified\":\"2026-11-13T14:01:31.407Z\",\"isPartOf\":{\"@id\":\"https://docs.comfy.org#website\"},\"breadcrumb\":{\"@id\":\"https://docs.comfy.org/ko/custom-nodes/backend/tensors#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.comfy.org/ko/custom-nodes/backend/tensors#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"커스텀 노드 구축\",\"item\":\"https://docs.comfy.org/ko/custom-nodes/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python (백엔드)\",\"item\":\"https://docs.comfy.org/ko/custom-nodes/backend/server_overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"torch.Tensor와 함께 작업하기\",\"item\":\"https://docs.comfy.org/ko/custom-nodes/backend/tensors\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.comfy.org/ko/custom-nodes/backend/tensors#article\",\"headline\":\"torch.Tensor와 함께 작업하기\",\"name\":\"torch.Tensor와 함께 작업하기\",\"description\":\"ComfyUI 커스텀 노드에 필요한 torch.Tensor 기초: 텐서 형태, squeeze/unsqueeze, 표기법, 요소별 연산, 텐서 진리값.\",\"url\":\"https://docs.comfy.org/ko/custom-nodes/backend/tensors\",\"mainEntityOfPage\":{\"@id\":\"https://docs.comfy.org/ko/custom-nodes/backend/tensors#webpage\"},\"dateModified\":\"2026-11-13T14:01:31.407Z\",\"publisher\":{\"@id\":\"https://docs.comfy.org/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.comfy.org#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"ComfyUI\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"ComfyUI\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/ko/custom-nodes/backend/tensors.md","siteName":"ComfyUI","nav":{"global":null,"languages":[{"language":"en","pages":[{"title":"en","href":"/custom-nodes/backend/tensors"}]},{"language":"zh","footer":{"socials":{"github":"https://github.com/Comfy-Org/ComfyUI","x":"https://x.com/ComfyUI","discord":"https://discord.com/invite/comfyorg","youtube":"https://www.youtube.com/@comfyorg"},"links":[{"header":"资源","items":[{"label":"安装","href":"/zh/installation/system_requirements"},{"label":"教程","href":"/zh/tutorials/basic/text-to-image"},{"label":"开发","href":"/zh/development/overview"}]},{"header":"产品","items":[{"label":"功能","href":"https://www.comfy.org/?utm_source=docs"},{"label":"画廊","href":"https://www.comfy.org/gallery?utm_source=docs"},{"label":"下载","href":"https://www.comfy.org/download?utm_source=docs"}]},{"header":"公司","items":[{"label":"关于","href":"https://www.comfy.org/about?utm_source=docs"},{"label":"招聘","href":"https://www.comfy.org/careers?utm_source=docs"},{"label":"服务条款","href":"https://www.comfy.org/terms-of-service?utm_source=docs"},{"label":"隐私政策","href":"https://www.comfy.org/privacy-policy?utm_source=docs"}]}]},"pages":[{"title":"zh","href":"/zh/custom-nodes/backend/tensors"}]},{"language":"ja","footer":{"socials":{"github":"https://github.com/Comfy-Org/ComfyUI","x":"https://x.com/ComfyUI","discord":"https://discord.com/invite/comfyorg","youtube":"https://www.youtube.com/@comfyorg"},"links":[{"header":"リソース","items":[{"label":"インストール","href":"/ja/installation/system_requirements"},{"label":"チュートリアル","href":"/ja/tutorials/basic/text-to-image"},{"label":"開発","href":"/ja/development/overview"}]},{"header":"プロダクト","items":[{"label":"機能","href":"https://www.comfy.org/?utm_source=docs"},{"label":"ギャラリー","href":"https://www.comfy.org/gallery?utm_source=docs"},{"label":"ダウンロード","href":"https://www.comfy.org/download?utm_source=docs"}]},{"header":"会社情報","items":[{"label":"概要","href":"https://www.comfy.org/about?utm_source=docs"},{"label":"採用情報","href":"https://www.comfy.org/careers?utm_source=docs"},{"label":"利用規約","href":"https://www.comfy.org/terms-of-service?utm_source=docs"},{"label":"プライバシーポリシー","href":"https://www.comfy.org/privacy-policy?utm_source=docs"}]}]},"navbar":{"links":[{"href":"/ja/tutorials/partner-nodes/pricing","label":"料金"},{"href":"https://comfy.org/download?utm_source=docs","label":"ダウンロード"}],"primary":{"type":"button","label":"Comfy Cloud","href":"https://comfy.org/cloud?utm_source=docs"}},"pages":[{"title":"ja","href":"/ja/custom-nodes/backend/tensors"}]},{"language":"ko","footer":{"socials":{"github":"https://github.com/Comfy-Org/ComfyUI","x":"https://x.com/ComfyUI","discord":"https://discord.com/invite/comfyorg","youtube":"https://www.youtube.com/@comfyorg"},"links":[{"header":"리소스","items":[{"label":"설치","href":"/ko/installation/system_requirements"},{"label":"튜토리얼","href":"/ko/tutorials/basic/text-to-image"},{"label":"개발","href":"/ko/development/overview"}]},{"header":"제품","items":[{"label":"기능","href":"https://www.comfy.org/?utm_source=docs"},{"label":"갤러리","href":"https://www.comfy.org/gallery?utm_source=docs"},{"label":"다운로드","href":"https://www.comfy.org/download?utm_source=docs"}]},{"header":"회사 정보","items":[{"label":"소개","href":"https://www.comfy.org/about?utm_source=docs"},{"label":"채용","href":"https://www.comfy.org/careers?utm_source=docs"},{"label":"이용약관","href":"https://www.comfy.org/terms-of-service?utm_source=docs"},{"label":"개인정보 처리방침","href":"https://www.comfy.org/privacy-policy?utm_source=docs"}]}]},"navbar":{"links":[{"href":"/ko/tutorials/partner-nodes/pricing","label":"가격 정책"},{"href":"https://comfy.org/download?utm_source=docs","label":"다운로드"}],"primary":{"type":"button","label":"Comfy Cloud","href":"https://comfy.org/cloud?utm_source=docs"}},"tabs":[{"tab":"시작하기","pages":[{"title":"시작하기","href":"/ko"}]},{"tab":"내장 노드 (Built-in Nodes)","pages":[{"title":"내장 노드 (Built-in Nodes)","href":"/ko/built-in-nodes/overview"}]},{"tab":"API 개발","pages":[{"title":"API 개발","href":"/ko/development/overview"}]},{"tab":"커스텀 노드","pages":[{"title":"ComfyUI 커스텀 노드 개발: 구축, 확장, 게시","sidebarTitle":"개요","href":"/ko/custom-nodes/intro"},{"group":"커스텀 노드 구축","pages":[{"title":"ComfyUI 커스텀 노드 유형과 구조","sidebarTitle":"노드 유형","href":"/ko/custom-nodes/overview"},{"title":"ComfyUI에서 커스텀 노드 만들기","sidebarTitle":"첫 노드 만들기","href":"/ko/custom-nodes/walkthrough"},{"group":"Python (백엔드)","pages":[{"title":"커스텀 노드 속성","sidebarTitle":"노드 속성","href":"/ko/custom-nodes/backend/server_overview"},{"title":"ComfyUI 커스텀 노드 라이프사이클","sidebarTitle":"노드 수명 주기","href":"/ko/custom-nodes/backend/lifecycle"},{"title":"ComfyUI 커스텀 노드 데이터 타입","sidebarTitle":"데이터 유형","href":"/ko/custom-nodes/backend/datatypes"},{"title":"이미지, 랜트, 마스크","sidebarTitle":"이미지, 랜트, 마스크","href":"/ko/custom-nodes/backend/images_and_masks"},{"title":"숨겨진 및 유연한 입력","sidebarTitle":"숨겨진 및 유연한 입력","href":"/ko/custom-nodes/backend/more_on_inputs"},{"title":"지연 평가: ComfyUI 커스텀 노드 입력 평가","sidebarTitle":"지연 평가","href":"/ko/custom-nodes/backend/lazy_evaluation"},{"title":"노드 확장","href":"/ko/custom-nodes/backend/expansion"},{"title":"ComfyUI 데이터 목록과 목록 처리","sidebarTitle":"리스트 및 리스트 처리","description":"ComfyUI가 커스텀 노드 간에 데이터를 Python 리스트로 전달하는 방식. 길이 1 래핑, 배치용 목록 처리, INPUT_IS_LIST와 OUTPUT_IS_LIST를 설명합니다.","href":"/ko/custom-nodes/backend/lists"},{"title":"torch.Tensor와 함께 작업하기","sidebarTitle":"텐서","href":"/ko/custom-nodes/backend/tensors"},{"title":"ComfyUI 커스텀 노드 Python 스니펫","description":"ComfyUI 커스텀 노드 코드 예제: 이미지 로드/저장, 마스크 반전, 마스크 형태 변환, 투명도 레이어로 마스크 사용, 노이즈 생성.","sidebarTitle":"Python 스니펫","href":"/ko/custom-nodes/backend/snippets"},{"title":"실행 모델 반전 가이드","sidebarTitle":"실행 모델","icon":"code-branch","href":"/ko/development/comfyui-server/execution_model_inversion_guide"}]},{"group":"JavaScript (UI)","pages":[{"title":"JavaScript 확장기능","sidebarTitle":"JavaScript 확장","href":"/ko/custom-nodes/js/javascript_overview"},{"title":"ComfyUI JavaScript 후크","sidebarTitle":"훅","href":"/ko/custom-nodes/js/javascript_hooks"},{"title":"컴피 오브젝트","href":"/ko/custom-nodes/js/javascript_objects_and_hijacking"},{"title":"설정 API","href":"/ko/custom-nodes/js/javascript_settings"},{"title":"ComfyUI 대화 API","sidebarTitle":"대화상자 API","href":"/ko/custom-nodes/js/javascript_dialog"},{"title":"ComfyUI Toast API","sidebarTitle":"토스트 API","href":"/ko/custom-nodes/js/javascript_toast"},{"title":"패널 배지에 대하여","href":"/ko/custom-nodes/js/javascript_about_panel_badges"},{"title":"하단 패널 탭","href":"/ko/custom-nodes/js/javascript_bottom_panel_tabs"},{"title":"사이드바 탭","href":"/ko/custom-nodes/js/javascript_sidebar_tabs"},{"title":"선택 도구 상자","href":"/ko/custom-nodes/js/javascript_selection_toolbox"},{"title":"명령어 및 키바인딩","href":"/ko/custom-nodes/js/javascript_commands_keybindings"},{"title":"ComfyUI 탑바 메뉴 API","sidebarTitle":"상단 메뉴 API","href":"/ko/custom-nodes/js/javascript_topbar_menu"},{"title":"ComfyUI 부그래프","sidebarTitle":"서브그래프","href":"/ko/custom-nodes/js/subgraphs"},{"title":"위젯과 커서를 위한 캔버스 포인터 API","sidebarTitle":"캔버스 포인터 API","href":"/ko/custom-nodes/js/canvas-pointer-api"},{"title":"커스텀 노드 JavaScript 예제: 메뉴, 이벤트, 훅","sidebarTitle":"JavaScript 예제","href":"/ko/custom-nodes/js/javascript_examples"}]},{"title":"ComfyUI 커스텀 노드 i18n: 노드 정의 현지화","sidebarTitle":"i18n 지원","href":"/ko/custom-nodes/i18n"},{"group":"마이그레이션 가이드","pages":[{"title":"ComfyUI 커스텀 노드 V3 마이그레이션: V1에서 V3 스키마로","href":"/ko/custom-nodes/v3_migration"},{"title":"컨텍스트 메뉴 API 마이그레이션: ComfyUI 캔버스 및 노드 메뉴","sidebarTitle":"컨텍스트 메뉴 마이그레이션","href":"/ko/custom-nodes/js/context-menu-migration"},{"title":"프론트엔드 확장 프로그램의 노드 ID 마이그레이션","sidebarTitle":"노드 ID 마이그레이션","href":"/ko/custom-nodes/js/node-id-migration"},{"title":"프런트엔드 확장의 링크 등록 마이그레이션","sidebarTitle":"링크 등록","href":"/ko/custom-nodes/js/link-registration-migration"},{"title":"프론트엔드 확장 프로그램을 위한 위젯 시스템 마이그레이션","sidebarTitle":"위젯 시스템 마이그레이션","href":"/ko/custom-nodes/js/widgets-migration"},{"title":"프론트엔드 확장 프로그램을 위한 연결 콜백 마이그레이션","sidebarTitle":"연결 콜백","href":"/ko/custom-nodes/js/connection-callbacks-migration"},{"title":"프런트엔드 확장 프로그램을 위한 직렬화 콜백 마이그레이션","sidebarTitle":"직렬화 콜백","href":"/ko/custom-nodes/js/serialization-callbacks-migration"},{"title":"프런트엔드 확장 프로그램의 노드 지오메트리 마이그레이션","sidebarTitle":"노드 지오메트리 마이그레이션","href":"/ko/custom-nodes/js/node-geometry-migration"},{"title":"프런트엔드 확장 프로그램을 위한 PrimeVue 제거 마이그레이션","sidebarTitle":"PrimeVue 제거","href":"/ko/custom-nodes/js/primevue-removal-migration"},{"title":"노드 교체","href":"/ko/custom-nodes/backend/node-replacement"}]}]},{"group":"패키지 및 게시","pages":[{"title":"ComfyUI 커스텀 노드 문서: Markdown 도움말 페이지","sidebarTitle":"노드 문서","href":"/ko/custom-nodes/help_page"},{"title":"워크플로 템플릿","href":"/ko/custom-nodes/workflow_templates"},{"title":"하위 그래프 블루프린트","href":"/ko/custom-nodes/subgraph_blueprints"},{"title":"Comfy Registry: 커스텀 노드 게시와 버전 관리","sidebarTitle":"Registry 개요","href":"/ko/registry/overview"},{"title":"Comfy Registry에 커스텀 노드 게시","sidebarTitle":"노드 게시","href":"/ko/registry/publishing"},{"title":"커스텀 노드를 ComfyUI Manager에 게시하기","sidebarTitle":"매니저에 게시하기","href":"/ko/custom-nodes/backend/manager"},{"title":"커스텀 노드 소유권 신청: Comfy Registry","sidebarTitle":"노드 신청","href":"/ko/registry/claim-my-node"},{"title":"Comfy Registry 노드 품질 및 보안 표준","sidebarTitle":"품질 및 보안 기준","href":"/ko/registry/standards"},{"title":"커스텀 노드 CI/CD","sidebarTitle":"CI/CD","href":"/ko/registry/cicd"},{"title":"pyproject.toml","href":"/ko/registry/specifications"},{"title":"API 개요","href":"/ko/registry/api-reference/overview"},{"group":"Registry API 참조","pages":[{"title":"Get information about the calling user.","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /users","href":"/ko/registry/api-reference/registry/get-information-about-the-calling-user"},{"title":"Retrieve all publishers for a given user","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /users/publishers/","href":"/ko/registry/api-reference/registry/retrieve-all-publishers-for-a-given-user"},{"title":"Validate if a publisher username is available","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /publishers/validate","href":"/ko/registry/api-reference/registry/validate-if-a-publisher-username-is-available"},{"title":"Create a new publisher","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi post /publishers","href":"/ko/registry/api-reference/registry/create-a-new-publisher"},{"title":"Retrieve all publishers","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /publishers","href":"/ko/registry/api-reference/registry/retrieve-all-publishers"},{"title":"Retrieve a publisher by ID","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /publishers/{publisherId}","href":"/ko/registry/api-reference/registry/retrieve-a-publisher-by-id"},{"title":"Update a publisher","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi put /publishers/{publisherId}","href":"/ko/registry/api-reference/registry/update-a-publisher"},{"title":"Delete a publisher","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi delete /publishers/{publisherId}","href":"/ko/registry/api-reference/registry/delete-a-publisher"},{"title":"Retrieve permissions the user has for a given publisher","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /publishers/{publisherId}/nodes/{nodeId}/permissions","href":"/ko/registry/api-reference/registry/retrieve-permissions-the-user-has-for-a-given-publisher"},{"title":"Create a new personal access token","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi post /publishers/{publisherId}/tokens","href":"/ko/registry/api-reference/registry/create-a-new-personal-access-token"},{"title":"Delete a specific personal access token","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi delete /publishers/{publisherId}/tokens/{tokenId}","href":"/ko/registry/api-reference/registry/delete-a-specific-personal-access-token"},{"title":"Retrieve all nodes","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /publishers/{publisherId}/nodes/v2","href":"/ko/registry/api-reference/registry/retrieve-all-nodes"},{"title":"Retrieve all nodes","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /publishers/{publisherId}/nodes/v2","href":"/ko/registry/api-reference/registry/retrieve-all-nodes"},{"title":"Create a new custom node","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi post /publishers/{publisherId}/nodes","href":"/ko/registry/api-reference/registry/create-a-new-custom-node"},{"title":"Update a specific node","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi put /publishers/{publisherId}/nodes/{nodeId}","href":"/ko/registry/api-reference/registry/update-a-specific-node"},{"title":"Delete a specific node","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi delete /publishers/{publisherId}/nodes/{nodeId}","href":"/ko/registry/api-reference/registry/delete-a-specific-node"},{"title":"Retrieve permissions the user has for a given publisher","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /publishers/{publisherId}/nodes/{nodeId}/permissions","href":"/ko/registry/api-reference/registry/retrieve-permissions-the-user-has-for-a-given-publisher"},{"title":"Claim nodeId into publisherId for the authenticated publisher","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi post /publishers/{publisherId}/nodes/{nodeId}/claim-my-node","href":"/ko/registry/api-reference/registry/claim-nodeid-into-publisherid-for-the-authenticated-publisher"},{"title":"Publish a new version of a node","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi post /publishers/{publisherId}/nodes/{nodeId}/versions","href":"/ko/registry/api-reference/registry/publish-a-new-version-of-a-node"},{"title":"Update changelog and deprecation status of a node version","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi put /publishers/{publisherId}/nodes/{nodeId}/versions/{versionId}","href":"/ko/registry/api-reference/registry/update-changelog-and-deprecation-status-of-a-node-version"},{"title":"Unpublish (delete) a specific version of a node","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi delete /publishers/{publisherId}/nodes/{nodeId}/versions/{versionId}","href":"/ko/registry/api-reference/registry/unpublish-delete-a-specific-version-of-a-node"},{"title":"Retrieves a list of nodes","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /nodes/search","href":"/ko/registry/api-reference/registry/retrieves-a-list-of-nodes"},{"title":"Retrieves a list of nodes","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /nodes/search","href":"/ko/registry/api-reference/registry/retrieves-a-list-of-nodes"},{"title":"Retrieve a specific node by ID","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /nodes/{nodeId}","href":"/ko/registry/api-reference/registry/retrieve-a-specific-node-by-id"},{"title":"Returns a node version to be installed.","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /nodes/{nodeId}/install","href":"/ko/registry/api-reference/registry/returns-a-node-version-to-be-installed"},{"title":"Add review to a specific version of a node","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi post /nodes/{nodeId}/reviews","href":"/ko/registry/api-reference/registry/add-review-to-a-specific-version-of-a-node"},{"title":"Create Node Translations","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi post /nodes/{nodeId}/translations","href":"/ko/registry/api-reference/registry/create-node-translations"},{"title":"List all versions of a node","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /nodes/{nodeId}/versions","href":"/ko/registry/api-reference/registry/list-all-versions-of-a-node"},{"title":"Retrieve a specific version of a node","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /nodes/{nodeId}/versions/{versionId}","href":"/ko/registry/api-reference/registry/retrieve-a-specific-version-of-a-node"},{"title":"Retrieve multiple node versions in a single request","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi post /bulk/nodes/versions","href":"/ko/registry/api-reference/registry/retrieve-multiple-node-versions-in-a-single-request"},{"title":"List all node versions given some filters.","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /versions","href":"/ko/registry/api-reference/registry/list-all-node-versions-given-some-filters"},{"title":"list all comfy-nodes","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /comfy-nodes","href":"/ko/registry/api-reference/registry/list-all-comfy-nodes"},{"title":"Retrieve a node by ComfyUI node name","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /comfy-nodes/{comfyNodeName}/node","href":"/ko/registry/api-reference/registry/retrieve-a-node-by-comfyui-node-name"},{"title":"create comfy-nodes for certain node","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi post /nodes/{nodeId}/versions/{version}/comfy-nodes","href":"/ko/registry/api-reference/registry/create-comfy-nodes-for-certain-node"},{"title":"list comfy-nodes for node version","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /nodes/{nodeId}/versions/{version}/comfy-nodes","href":"/ko/registry/api-reference/registry/list-comfy-nodes-for-node-version"},{"title":"get specify comfy-node based on its id","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /nodes/{nodeId}/versions/{version}/comfy-nodes/{comfyNodeName}","href":"/ko/registry/api-reference/registry/get-specify-comfy-node-based-on-its-id"},{"title":"Update a specific comfy-node","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi put /nodes/{nodeId}/versions/{version}/comfy-nodes/{comfyNodeName}","href":"/ko/registry/api-reference/registry/update-a-specific-comfy-node"},{"title":"Get server feature flags","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /features","href":"/ko/registry/api-reference/registry/get-server-feature-flags"},{"title":"Get release notes","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /releases","href":"/ko/registry/api-reference/releases/get-release-notes"}]}]}]},{"tab":"지원","pages":[{"title":"지원","href":"/ko/support/contact-support"}]},{"tab":"Cloud API 참조","pages":[{"title":"Cloud API 참조","href":"/ko/api-reference/cloud/workflow/get-information-about-current-prompt-executions"}]}]},{"language":"es","pages":[{"title":"es","href":"/es/custom-nodes/backend/tensors"}]}]},"basePath":"","title":"torch.Tensor와 함께 작업하기 - ComfyUI","deploymentId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","buildId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","dynamics":[],"chunks":[]}