torch.Tensor in einem ComfyUI Custom Node bearbeiten: Formen, squeeze und unsqueeze, Notation, elementweise Operationen und Wahrheitswert.
pytorch, Tensoren und torch.Tensor
Die gesamte Kernrechenarbeit in Comfy erledigt pytorch. Wenn Ihre Custom Nodes bis in die Eingeweide von Stable Diffusion vordringen sollen, müssen Sie sich mit dieser Bibliothek vertraut machen, was den Rahmen dieser Einführung bei Weitem sprengt.Viele Custom Nodes müssen jedoch Bilder, Latents und Masken bearbeiten, die intern jeweils als torch.Tensor dargestellt werden. Setzen Sie sich also ein Lesezeichen auf die
Dokumentation für torch.Tensor.
Was ist ein Tensor?
torch.Tensor repräsentiert einen Tensor, also die mathematische Verallgemeinerung eines Vektors oder einer Matrix auf eine beliebige Anzahl von Dimensionen.
Der Rang eines Tensors ist die Anzahl seiner Dimensionen (ein Vektor hat Rang 1, eine Matrix Rang 2); seine Form beschreibt die
Größe jeder Dimension.Ein RGB-Bild (mit der Höhe H und der Breite W) kann man sich also als drei Arrays (eines pro Farbkanal) vorstellen, die jeweils H x W groß sind,
was sich als Tensor mit der Form[H,W,3] darstellen lässt. In Comfy kommen Bilder fast immer in einem Batch (auch wenn der Batch
nur ein einziges Bild enthält). torch stellt die Batch-Dimension immer an die erste Stelle, daher haben Comfy-Bilder die Form[B,H,W,3],
üblicherweise geschrieben als [B,H,W,C], wobei C für Channels (Kanäle) steht.
squeeze, unsqueeze und reshape
Wenn ein Tensor eine Dimension der Größe 1 hat (eine sogenannte kollabierte Dimension), dann entspricht er demselben Tensor ohne diese Dimension
(ein Batch mit 1 Bild ist einfach ein Bild). Das Entfernen einer solchen kollabierten Dimension nennt man Squeezing,
das Einfügen Unsqueezing.
Manche torch-Codes und manche Autoren von Custom Nodes geben einen gesqueezten Tensor zurück, wenn eine Dimension kollabiert ist,
etwa wenn ein Batch nur ein einziges Element enthält. Das ist eine häufige Ursache für Bugs!
Dieselben Daten in einer anderen Form darzustellen, nennt man Reshaping. Das erfordert oft, dass Sie die
zugrunde liegende Datenstruktur kennen, gehen Sie also vorsichtig damit um!
Wichtige Notation
torch.Tensor unterstützt den Großteil der Python-Slice-Notation, Iteration und andere gängige listenähnliche Operationen. Ein Tensor
hat außerdem ein Attribut .shape, das seine Größe als torch.Size zurückgibt (eine Unterklasse von tuple, die auch so
behandelt werden kann).Es gibt noch einige andere wichtige Notationselemente, die Sie häufig sehen werden (einige davon sind eher ungewöhnliche
Standard-Python-Notation, die Ihnen im Umgang mit Tensoren aber viel häufiger begegnet):
torch.Tensor unterstützt die Verwendung von None in der Slice-Notation,
um das Einfügen einer Dimension der Größe 1 anzuzeigen.
: wird beim Slicen eines Tensors häufig verwendet; das bedeutet einfach „die gesamte Dimension behalten“.
Es ist wie a[start:end] in Python, nur dass Start- und Endpunkt weggelassen werden.
... steht für „die Gesamtheit einer nicht näher bestimmten Anzahl von Dimensionen“. a[0, ...] würde also das erste
Element eines Batches extrahieren, unabhängig von der Anzahl der Dimensionen.
Bei Methoden, die eine Form als Argument erwarten, wird diese oft als tuple der Dimensionen übergeben,
wobei eine einzelne Dimension die Größe -1 erhalten kann, was bedeutet, dass die Größe dieser Dimension
anhand der Gesamtgröße der Daten berechnet werden soll.
>>> a = torch.Tensor((1,2))>>> a.shapetorch.Size([2])>>> a[:,None].shape torch.Size([2, 1])>>> a.reshape((1,-1)).shapetorch.Size([1, 2])
Elementweise Operationen
Viele binäre Operatoren auf torch.Tensor (darunter ’+’, ’-’, ’*’, ’/’ und ’==’) werden elementweise angewendet (unabhängig auf jedes Element).
Die Operanden müssen entweder zwei Tensoren mit broadcast-kompatiblen Formen oder ein Tensor und ein Skalar sein. Also:
>>> 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
Wahrheitswert von Tensoren
Der „Wahrheitswert“ eines Tensors ist nicht derselbe wie der einer Python-Liste.
Vielleicht kennen Sie den Wahrheitswert einer Python-Liste: True für jede nicht leere Liste und False für None oder [].
Ein torch.Tensor (mit mehr als einem Element) hat dagegen keinen definierten Wahrheitswert. Stattdessen müssen Sie
.all() oder .any() verwenden, um die elementweisen Wahrheitswerte zu kombinieren:
>>> 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)
Das bedeutet auch, dass Sie if a is not None: statt if a: verwenden müssen, um festzustellen, ob eine Tensor-Variable gesetzt wurde.
{"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"},{"language":"de","href":"de"},{"language":"ru","href":"ru"}]}},"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":"","_id":"6b10a4c49ffae5051c3f9d3b"},"feedback":{"thumbs":true,"edits":true,"issues":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6b12b146fbab6d15d8a6dec0","clientVersion":"0.0.4448","searchFilterCounts":[{"language":"en","tag":"Built-in Nodes","count":1224},{"language":"ja","tag":"組み込みノード","count":1224},{"language":"zh","tag":"内置节点","count":1224},{"language":"en","tag":"Nodes","count":1223},{"language":"ja","tag":"ノード","count":1223},{"language":"zh","tag":"节点","count":1223},{"language":"ko","tag":"내장 노드 (Built-in Nodes)","count":1182},{"language":"ko","tag":"노드","count":1181},{"language":"es","tag":"Nodos integrados","count":1116},{"language":"es","tag":"Nodes","count":1115},{"language":"ru","tag":"Встроенные узлы","count":1115},{"language":"ru","tag":"Узлы","count":1114},{"language":"de","tag":"Tutorials","count":458},{"language":"en","tag":"Partner","count":395},{"language":"ja","tag":"Partner","count":395},{"language":"ko","tag":"Partner","count":395},{"language":"zh","tag":"Partner","count":395},{"language":"es","tag":"Partner","count":393},{"language":"ru","tag":"Partner","count":392},{"language":"en","tag":"Model","count":385},{"language":"es","tag":"Modelo","count":385},{"language":"ja","tag":"Model","count":385},{"language":"ko","tag":"Model","count":385},{"language":"ru","tag":"Model","count":385},{"language":"zh","tag":"Model","count":385},{"language":"en","tag":"Image","count":369},{"language":"en","tag":"Comfy Router","count":355},{"language":"de","tag":"Comfy Router","count":355},{"language":"es","tag":"Comfy Router","count":355},{"language":"ja","tag":"Comfy Router","count":355},{"language":"ko","tag":"Comfy Router","count":355},{"language":"ru","tag":"Comfy Router","count":355},{"language":"zh","tag":"Comfy Router","count":355},{"language":"es","tag":"Imagen","count":339},{"language":"en","tag":"Tutorials","count":337},{"language":"es","tag":"Tutoriales","count":337},{"language":"ja","tag":"チュートリアル","count":337},{"language":"ko","tag":"튜토리얼","count":337},{"language":"ru","tag":"Руководства","count":337},{"language":"zh","tag":"教程","count":337},{"language":"en","tag":"Agent tools","count":327},{"language":"en","tag":"Models","count":323},{"language":"de","tag":"Modelle","count":323},{"language":"es","tag":"Models","count":323},{"language":"ja","tag":"Models","count":323},{"language":"ko","tag":"Models","count":323},{"language":"ru","tag":"Модели","count":323},{"language":"zh","tag":"Models","count":323},{"language":"en","tag":"All Models","count":320},{"language":"de","tag":"Alle Modelle","count":320},{"language":"es","tag":"All Models","count":320},{"language":"ja","tag":"All Models","count":320},{"language":"ko","tag":"All Models","count":320},{"language":"ru","tag":"Все модели","count":320},{"language":"zh","tag":"All Models","count":320},{"language":"es","tag":"Video","count":291},{"language":"de","tag":"Entwickler","count":236},{"language":"ja","tag":"開発者向け","count":236},{"language":"ko","tag":"개발자","count":236},{"language":"ru","tag":"Для разработчиков","count":236},{"language":"zh","tag":"开发者","count":236},{"language":"ko","tag":"이미지","count":227},{"language":"ja","tag":"画像","count":223},{"language":"zh","tag":"图像","count":223},{"language":"ru","tag":"Video","count":184},{"language":"de","tag":"Partner-Nodes","count":171},{"language":"de","tag":"Partner-Modelle","count":164},{"language":"de","tag":"ComfyUI bereitstellen","count":139},{"language":"de","tag":"Video","count":107},{"language":"de","tag":"Bild","count":96}],"searchSettings":{"maxResults":10}},"assistantConfig":{"enableStarterQuestions":false},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","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":"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":"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":"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":"turbopuffer-dual-write","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":"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":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"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}#content img:not([data-component-part=\"card-image\"]){max-width:min(100%, 750px)}#content .frame:has(img){max-width:calc(750px + 1rem)}"},{"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":"de/custom-nodes/backend/tensors","slug":"/de/custom-nodes/backend/tensors","pageMetadata":{"title":"torch.Tensor in ComfyUI: Formen und Operationen","sidebarTitle":"Tensoren","description":"torch.Tensor in einem ComfyUI Custom Node bearbeiten: Formen, squeeze und unsqueeze, Notation, elementweise Operationen und Wahrheitswert.","translationSourceHash":1.356e+129,"translationFrom":"custom-nodes/backend/tensors.mdx","href":"/de/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: \"torch.Tensor in einem ComfyUI Custom Node bearbeiten: Formen, squeeze und unsqueeze, Notation, elementweise Operationen und Wahrheitswert.\"\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:`pytorch-tensoren-und-torch-tensor`,children:`pytorch, Tensoren und torch.Tensor`}),`\n`,_jsxs(_components.p,{children:[`Die gesamte Kernrechenarbeit in Comfy erledigt `,_jsx(_components.a,{href:`https://pytorch.org/`,children:`pytorch`}),`. Wenn Ihre Custom Nodes bis in die Eingeweide von Stable Diffusion vordringen sollen, müssen Sie sich mit dieser Bibliothek vertraut machen, was den Rahmen dieser Einführung bei Weitem sprengt.`]}),`\n`,_jsxs(_components.p,{children:[`Viele Custom Nodes müssen jedoch Bilder, Latents und Masken bearbeiten, die intern jeweils als `,_jsx(_components.code,{children:`torch.Tensor`}),` dargestellt werden. Setzen Sie sich also ein Lesezeichen auf die\n`,_jsx(_components.a,{href:`https://pytorch.org/docs/stable/tensors.html`,children:`Dokumentation für torch.Tensor`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`was-ist-ein-tensor`,children:`Was ist ein Tensor?`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`torch.Tensor`}),` repräsentiert einen Tensor, also die mathematische Verallgemeinerung eines Vektors oder einer Matrix auf eine beliebige Anzahl von Dimensionen.\nDer `,_jsx(_components.em,{children:`Rang`}),` eines Tensors ist die Anzahl seiner Dimensionen (ein Vektor hat `,_jsx(_components.em,{children:`Rang`}),` 1, eine Matrix `,_jsx(_components.em,{children:`Rang`}),` 2); seine `,_jsx(_components.em,{children:`Form`}),` beschreibt die\nGröße jeder Dimension.`]}),`\n`,_jsxs(_components.p,{children:[`Ein RGB-Bild (mit der Höhe H und der Breite W) kann man sich also als drei Arrays (eines pro Farbkanal) vorstellen, die jeweils H x W groß sind,\nwas sich als Tensor mit der `,_jsx(_components.em,{children:`Form`}),` `,_jsx(_components.code,{children:`[H,W,3]`}),` darstellen lässt. In Comfy kommen Bilder fast immer in einem Batch (auch wenn der Batch\nnur ein einziges Bild enthält). `,_jsx(_components.code,{children:`torch`}),` stellt die Batch-Dimension immer an die erste Stelle, daher haben Comfy-Bilder die `,_jsx(_components.em,{children:`Form`}),` `,_jsx(_components.code,{children:`[B,H,W,3]`}),`,\nüblicherweise geschrieben als `,_jsx(_components.code,{children:`[B,H,W,C]`}),`, wobei C für Channels (Kanäle) steht.`]}),`\n`,_jsx(Heading,{level:`3`,id:`squeeze-unsqueeze-und-reshape`,children:`squeeze, unsqueeze und reshape`}),`\n`,_jsx(_components.p,{children:`Wenn ein Tensor eine Dimension der Größe 1 hat (eine sogenannte kollabierte Dimension), dann entspricht er demselben Tensor ohne diese Dimension\n(ein Batch mit 1 Bild ist einfach ein Bild). Das Entfernen einer solchen kollabierten Dimension nennt man Squeezing,\ndas Einfügen Unsqueezing.`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Manche torch-Codes und manche Autoren von Custom Nodes geben einen gesqueezten Tensor zurück, wenn eine Dimension kollabiert ist,\netwa wenn ein Batch nur ein einziges Element enthält. Das ist eine häufige Ursache für Bugs!`})}),`\n`,_jsx(_components.p,{children:`Dieselben Daten in einer anderen Form darzustellen, nennt man Reshaping. Das erfordert oft, dass Sie die\nzugrunde liegende Datenstruktur kennen, gehen Sie also vorsichtig damit um!`}),`\n`,_jsx(Heading,{level:`3`,id:`wichtige-notation`,children:`Wichtige Notation`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`torch.Tensor`}),` unterstützt den Großteil der Python-Slice-Notation, Iteration und andere gängige listenähnliche Operationen. Ein Tensor\nhat außerdem ein Attribut `,_jsx(_components.code,{children:`.shape`}),`, das seine Größe als `,_jsx(_components.code,{children:`torch.Size`}),` zurückgibt (eine Unterklasse von `,_jsx(_components.code,{children:`tuple`}),`, die auch so\nbehandelt werden kann).`]}),`\n`,_jsx(_components.p,{children:`Es gibt noch einige andere wichtige Notationselemente, die Sie häufig sehen werden (einige davon sind eher ungewöhnliche\nStandard-Python-Notation, die Ihnen im Umgang mit Tensoren aber viel häufiger begegnet):`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`torch.Tensor`}),` unterstützt die Verwendung von `,_jsx(_components.code,{children:`None`}),` in der Slice-Notation,\num das Einfügen einer Dimension der Größe 1 anzuzeigen.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`:`}),` wird beim Slicen eines Tensors häufig verwendet; das bedeutet einfach „die gesamte Dimension behalten“.\nEs ist wie `,_jsx(_components.code,{children:`a[start:end]`}),` in Python, nur dass Start- und Endpunkt weggelassen werden.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`...`}),` steht für „die Gesamtheit einer nicht näher bestimmten Anzahl von Dimensionen“. `,_jsx(_components.code,{children:`a[0, ...]`}),` würde also das erste\nElement eines Batches extrahieren, unabhängig von der Anzahl der Dimensionen.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Bei Methoden, die eine Form als Argument erwarten, wird diese oft als `,_jsx(_components.code,{children:`tuple`}),` der Dimensionen übergeben,\nwobei eine einzelne Dimension die Größe `,_jsx(_components.code,{children:`-1`}),` erhalten kann, was bedeutet, dass die Größe dieser Dimension\nanhand der Gesamtgröße der Daten berechnet werden soll.`]}),`\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:`elementweise-operationen`,children:`Elementweise Operationen`}),`\n`,_jsxs(_components.p,{children:[`Viele binäre Operatoren auf `,_jsx(_components.code,{children:`torch.Tensor`}),` (darunter ’+’, ’-’, ’*’, ’/’ und ’==’) werden elementweise angewendet (unabhängig auf jedes Element).\nDie Operanden müssen `,_jsx(_components.em,{children:`entweder`}),` zwei Tensoren mit broadcast-kompatiblen Formen `,_jsx(_components.em,{children:`oder`}),` ein Tensor und ein Skalar sein. Also:`]}),`\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:`wahrheitswert-von-tensoren`,children:`Wahrheitswert von Tensoren`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Der „Wahrheitswert“ eines Tensors ist nicht derselbe wie der einer Python-Liste.`})}),`\n`,_jsxs(_components.p,{children:[`Vielleicht kennen Sie den Wahrheitswert einer Python-Liste: `,_jsx(_components.code,{children:`True`}),` für jede nicht leere Liste und `,_jsx(_components.code,{children:`False`}),` für `,_jsx(_components.code,{children:`None`}),` oder `,_jsx(_components.code,{children:`[]`}),`.\nEin `,_jsx(_components.code,{children:`torch.Tensor`}),` (mit mehr als einem Element) hat dagegen keinen definierten Wahrheitswert. Stattdessen müssen Sie\n`,_jsx(_components.code,{children:`.all()`}),` oder `,_jsx(_components.code,{children:`.any()`}),` verwenden, um die elementweisen Wahrheitswerte zu kombinieren:`]}),`\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:[`Das bedeutet auch, dass Sie `,_jsx(_components.code,{children:`if a is not None:`}),` statt `,_jsx(_components.code,{children:`if a:`}),` verwenden müssen, um festzustellen, ob eine Tensor-Variable gesetzt wurde.`]})]})}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 in ComfyUI: Formen und Operationen","sidebarTitle":"Tensoren","description":"torch.Tensor in einem ComfyUI Custom Node bearbeiten: Formen, squeeze und unsqueeze, Notation, elementweise Operationen und Wahrheitswert.","translationSourceHash":1.356e+129,"translationFrom":"custom-nodes/backend/tensors.mdx","href":"/de/custom-nodes/backend/tensors"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"pytorch, Tensoren und torch.Tensor","slug":"pytorch-tensoren-und-torch-tensor","depth":2,"children":[{"title":"Was ist ein Tensor?","slug":"was-ist-ein-tensor","depth":3,"children":[]},{"title":"squeeze, unsqueeze und reshape","slug":"squeeze-unsqueeze-und-reshape","depth":3,"children":[]},{"title":"Wichtige Notation","slug":"wichtige-notation","depth":3,"children":[]},{"title":"Elementweise Operationen","slug":"elementweise-operationen","depth":3,"children":[]},{"title":"Wahrheitswert von Tensoren","slug":"wahrheitswert-von-tensoren","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/dripart/0598a3d384a97986/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 in ComfyUI: Formen und Operationen - ComfyUI","contextualStarterQuestions":[],"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":1},"es":{"href":"/es/custom-nodes/backend/tensors","matchLevel":1},"de":{"href":"/de/custom-nodes/backend/tensors","matchLevel":0},"ru":{"href":"/ru/custom-nodes/backend/tensors","matchLevel":1}}},"lastModified":"2026-12-04T12:17:58.960Z","originalFileLocation":"de/custom-nodes/backend/tensors.mdx","locale":"de"},"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=\"torch.Tensor in einem ComfyUI Custom Node bearbeiten: Formen, squeeze und unsqueeze, Notation, elementweise Operationen und Wahrheitswert.\">\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 in ComfyUI: Formen und Operationen - ComfyUI\">\u003cmeta data-mint-head property=\"og:description\" content=\"torch.Tensor in einem ComfyUI Custom Node bearbeiten: Formen, squeeze und unsqueeze, Notation, elementweise Operationen und Wahrheitswert.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ComfyUI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.comfy.org/de/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+%28Backend%29\u0026amp;title=torch.Tensor+in+ComfyUI%3A+Formen+und+Operationen\u0026amp;description=torch.Tensor+in+einem+ComfyUI+Custom+Node+bearbeiten%3A+Formen%2C+squeeze+und+unsqueeze%2C+Notation%2C+elementweise+Operationen+und+Wahrheitswert.\u0026amp;theme=b252c39adf72ba65053766a0\u0026amp;signature=9a86ae507870a64a72d468e124b8c3aa3f9fd52f3960c02035137d7b974865e8\">\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 in ComfyUI: Formen und Operationen - ComfyUI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"torch.Tensor in einem ComfyUI Custom Node bearbeiten: Formen, squeeze und unsqueeze, Notation, elementweise Operationen und Wahrheitswert.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dripart.mintlify.site/_mintlify/api/og/v2?division=Python+%28Backend%29\u0026amp;title=torch.Tensor+in+ComfyUI%3A+Formen+und+Operationen\u0026amp;description=torch.Tensor+in+einem+ComfyUI+Custom+Node+bearbeiten%3A+Formen%2C+squeeze+und+unsqueeze%2C+Notation%2C+elementweise+Operationen+und+Wahrheitswert.\u0026amp;theme=b252c39adf72ba65053766a0\u0026amp;signature=9a86ae507870a64a72d468e124b8c3aa3f9fd52f3960c02035137d7b974865e8\">\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/de/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=\"/de/custom-nodes/backend/tensors.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://docs.comfy.org/de/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=\"ko\" href=\"https://docs.comfy.org/ko/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=\"ru\" href=\"https://docs.comfy.org/ru/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/de/custom-nodes/backend/tensors#webpage\",\"url\":\"https://docs.comfy.org/de/custom-nodes/backend/tensors\",\"name\":\"torch.Tensor in ComfyUI: Formen und Operationen\",\"description\":\"torch.Tensor in einem ComfyUI Custom Node bearbeiten: Formen, squeeze und unsqueeze, Notation, elementweise Operationen und Wahrheitswert.\",\"dateModified\":\"2026-12-04T12:17:58.960Z\",\"isPartOf\":{\"@id\":\"https://docs.comfy.org#website\"},\"breadcrumb\":{\"@id\":\"https://docs.comfy.org/de/custom-nodes/backend/tensors#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.comfy.org/de/custom-nodes/backend/tensors#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Custom Nodes\",\"item\":\"https://docs.comfy.org/de/custom-nodes/intro\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Custom Nodes erstellen\",\"item\":\"https://docs.comfy.org/de/custom-nodes/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python (Backend)\",\"item\":\"https://docs.comfy.org/de/custom-nodes/backend/server_overview\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"torch.Tensor in ComfyUI: Formen und Operationen\",\"item\":\"https://docs.comfy.org/de/custom-nodes/backend/tensors\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.comfy.org/de/custom-nodes/backend/tensors#article\",\"headline\":\"torch.Tensor in ComfyUI: Formen und Operationen\",\"name\":\"torch.Tensor in ComfyUI: Formen und Operationen\",\"description\":\"torch.Tensor in einem ComfyUI Custom Node bearbeiten: Formen, squeeze und unsqueeze, Notation, elementweise Operationen und Wahrheitswert.\",\"url\":\"https://docs.comfy.org/de/custom-nodes/backend/tensors\",\"mainEntityOfPage\":{\"@id\":\"https://docs.comfy.org/de/custom-nodes/backend/tensors#webpage\"},\"dateModified\":\"2026-12-04T12:17:58.960Z\",\"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":"/de/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"}},"pages":[{"title":"ko","href":"/ko/custom-nodes/backend/tensors"}]},{"language":"es","pages":[{"title":"es","href":"/es/custom-nodes/backend/tensors"}]},{"language":"de","tabs":[{"tab":"Erste Schritte","pages":[{"title":"Erste Schritte","href":"/de"}]},{"tab":"Tutorials","pages":[{"title":"Tutorials","href":"/de/basic-concepts/workflow"}]},{"tab":"Comfy Router","pages":[{"title":"Comfy Router","href":"/de/development/comfy-router/quickstart"}]},{"tab":"Agent-Tools","pages":[{"title":"Agent-Tools","href":"/de/agent-tools"}]},{"tab":"Entwickler","pages":[{"group":"Mit Comfy entwickeln","pages":[{"title":"ComfyUI für Entwickler: SDKs, Server-API und Cloud","sidebarTitle":"Entwicklerübersicht","href":"/de/development/overview"},{"title":"API-Schlüssel erhalten","sidebarTitle":"API-Schlüssel","icon":"key","href":"/de/development/api-development/getting-an-api-key"},{"title":"Comfy API-Beispiele: Router-Aufrufe, Bereitstellungen und Apps","sidebarTitle":"Beispiele","icon":"code","mode":"wide","href":"/de/development/examples"}]},{"group":"ComfyUI bereitstellen","pages":[{"title":"ComfyUI bereitstellen","sidebarTitle":"Übersicht","icon":"map","href":"/de/development/deploy/overview"},{"group":"Comfy Cloud","root":{"title":"Auf Comfy Cloud bereitstellen","sidebarTitle":"Auf Comfy Cloud bereitstellen","icon":"cloud","href":"/de/development/deploy/cloud"},"pages":[{"title":"Auf Comfy Cloud bereitstellen","sidebarTitle":"Auf Comfy Cloud bereitstellen","icon":"cloud","href":"/de/development/deploy/cloud"},{"title":"Benutzerdefinierte Builds zu Comfy Cloud hinzufügen","sidebarTitle":"Benutzerdefinierte Builds","icon":"puzzle-piece","href":"/de/development/deploy/cloud-custom-builds"},{"title":"Comfy Cloud Deployments und Build-Versionen verwalten","sidebarTitle":"Deployments verwalten","icon":"cloud-arrow-up","href":"/de/development/serverless/overview"},{"group":"Serverless-API-Referenz","pages":[{"group":"Builds und Uploads","pages":[{"group":"API Reference","pages":[{"title":"List the model directories a model may be placed in","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/model-directories","href":"/de/api-reference/builder/list-the-model-directories-a-model-may-be-placed-in"},{"title":"Find download sources for model filenames","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/models/resolve","href":"/de/api-reference/builder/find-download-sources-for-model-filenames"},{"title":"Read a ComfyUI Desktop snapshot as a build definition","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/snapshots/resolve","href":"/de/api-reference/builder/read-a-comfyui-desktop-snapshot-as-a-build-definition"},{"title":"Store a local ComfyUI installation for the Create a Build wizard","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/import-bundles","href":"/de/api-reference/builder/store-a-local-comfyui-installation-for-the-create-a-build-wizard"},{"title":"Open a stored import bundle","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/import-bundles/{id}","href":"/de/api-reference/builder/open-a-stored-import-bundle"},{"title":"List the curated base images a build may build on","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/base-images","href":"/de/api-reference/builder/list-the-curated-base-images-a-build-may-build-on"},{"title":"List the build targets a release can be cut for","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/build-targets","href":"/de/api-reference/builder/list-the-build-targets-a-release-can-be-cut-for"},{"title":"The build ceilings this workspace is held to","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/limits","href":"/de/api-reference/builder/the-build-ceilings-this-workspace-is-held-to"},{"title":"List the workspace's builds","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/builds","href":"/de/api-reference/builder/list-the-workspaces-builds"},{"title":"Create a build","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/builds","href":"/de/api-reference/builder/create-a-build"},{"title":"Create a build from a ComfyUI Desktop snapshot","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/builds/from-snapshot","href":"/de/api-reference/builder/create-a-build-from-a-comfyui-desktop-snapshot"},{"title":"Read a ComfyUI workflow as a build definition","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/workflows/resolve","href":"/de/api-reference/builder/read-a-comfyui-workflow-as-a-build-definition"},{"title":"Check that a definition installs every node a workflow uses","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/workflows/validate","href":"/de/api-reference/builder/check-that-a-definition-installs-every-node-a-workflow-uses"},{"title":"Create a build from a ComfyUI workflow","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/builds/from-workflow","href":"/de/api-reference/builder/create-a-build-from-a-comfyui-workflow"},{"title":"Get a build with its full definition","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/builds/{id}","href":"/de/api-reference/builder/get-a-build-with-its-full-definition"},{"title":"Delete a build","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml delete /v1/builds/{id}","href":"/de/api-reference/builder/delete-a-build"},{"title":"Edit a build's definition","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml patch /v1/builds/{id}","href":"/de/api-reference/builder/edit-a-builds-definition"},{"title":"Dry-run resolve a definition","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/builds/{id}/validate","href":"/de/api-reference/builder/dry-run-resolve-a-definition"},{"title":"List a build's releases","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/builds/{id}/releases","href":"/de/api-reference/builder/list-a-builds-releases"},{"title":"Cut and build a release","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/builds/{id}/releases","href":"/de/api-reference/builder/cut-and-build-a-release"},{"title":"Name releases by their build and version","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/release-labels","href":"/de/api-reference/builder/name-releases-by-their-build-and-version"},{"title":"Check a release's status","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/releases/{id}","href":"/de/api-reference/builder/check-a-releases-status"},{"title":"Delete a release","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml delete /v1/releases/{id}","href":"/de/api-reference/builder/delete-a-release"},{"title":"List a release's models, custom nodes, pip dependencies, ComfyUI commit and runtime policies","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/releases/{id}/manifest","href":"/de/api-reference/builder/list-a-releases-models-custom-nodes-pip-dependencies-comfyui-commit-and-runtime-policies"},{"title":"Read a release's full build log","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/releases/{id}/logs","href":"/de/api-reference/builder/read-a-releases-full-build-log"},{"title":"Read a release's node catalog (object_info) for one built target","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/releases/{id}/catalog","href":"/de/api-reference/builder/read-a-releases-node-catalog-object_info-for-one-built-target"},{"title":"Read a release's custom-node frontend files for one built target","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/releases/{id}/extensions","href":"/de/api-reference/builder/read-a-releases-custom-node-frontend-files-for-one-built-target"},{"title":"Read the HTTP routes a release's custom node packs register, for one built target","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/releases/{id}/routes","href":"/de/api-reference/builder/read-the-http-routes-a-releases-custom-node-packs-register-for-one-built-target"},{"title":"Read the custom node packs a release built without, for one built target","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/releases/{id}/unsupported-packs","href":"/de/api-reference/builder/read-the-custom-node-packs-a-release-built-without-for-one-built-target"},{"title":"Build an additional target for a cut release","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/releases/{id}/artifacts","href":"/de/api-reference/builder/build-an-additional-target-for-a-cut-release"},{"title":"Get a signed download link for a build artifact","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/build-artifacts/{id}/download","href":"/de/api-reference/builder/get-a-signed-download-link-for-a-build-artifact"},{"title":"List the workspace's private content","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml get /v1/blobs","href":"/de/api-reference/builder/list-the-workspaces-private-content"},{"title":"Get a scoped upload URL for private content","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/blobs","href":"/de/api-reference/builder/get-a-scoped-upload-url-for-private-content"},{"title":"Delete a private upload","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml delete /v1/blobs/{id}","href":"/de/api-reference/builder/delete-a-private-upload"},{"title":"Get fresh links for the pieces of an upload not landed yet","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/blobs/{id}/parts","href":"/de/api-reference/builder/get-fresh-links-for-the-pieces-of-an-upload-not-landed-yet"},{"title":"Join an upload's pieces into its one object","deprecated":null,"version":null,"openapi":"/openapi-builder.yaml post /v1/blobs/{id}/complete","href":"/de/api-reference/builder/join-an-uploads-pieces-into-its-one-object"}]}]},{"group":"Bereitstellungen","pages":[{"group":"API Reference","pages":[{"title":"List the caller's deployments","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/deployments","href":"/de/api-reference/deploy/list-the-callers-deployments"},{"title":"Create a deployment","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml post /v1/deployments","href":"/de/api-reference/deploy/create-a-deployment"},{"title":"Get a deployment's status","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/deployments/{id}","href":"/de/api-reference/deploy/get-a-deployments-status"},{"title":"Delete a deployment","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml delete /v1/deployments/{id}","href":"/de/api-reference/deploy/delete-a-deployment"},{"title":"Update a deployment's compute config, or move it to another release","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml patch /v1/deployments/{id}","href":"/de/api-reference/deploy/update-a-deployments-compute-config-or-move-it-to-another-release"},{"title":"Get a deployment's status timeline","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/deployments/{id}/events","href":"/de/api-reference/deploy/get-a-deployments-status-timeline"},{"title":"Get a deployment's revision history","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/deployments/{id}/revisions","href":"/de/api-reference/deploy/get-a-deployments-revision-history"},{"title":"Roll a deployment back to an earlier revision's release","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml post /v1/deployments/{id}/rollback","href":"/de/api-reference/deploy/roll-a-deployment-back-to-an-earlier-revisions-release"},{"title":"Delete a release a deployment keeps","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml delete /v1/deployments/{id}/releases/{releaseId}","href":"/de/api-reference/deploy/delete-a-release-a-deployment-keeps"},{"title":"Stop a release a deployment keeps","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml patch /v1/deployments/{id}/releases/{releaseId}","href":"/de/api-reference/deploy/stop-a-release-a-deployment-keeps"},{"title":"List the model files added to a deployment","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/deployments/{id}/models","href":"/de/api-reference/deploy/list-the-model-files-added-to-a-deployment"},{"title":"Add a model file to a deployment","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml post /v1/deployments/{id}/models","href":"/de/api-reference/deploy/add-a-model-file-to-a-deployment"},{"title":"Remove a model file added to a deployment","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml delete /v1/deployments/{id}/models/{modelId}","href":"/de/api-reference/deploy/remove-a-model-file-added-to-a-deployment"},{"title":"Get a deployment's captured ComfyUI log","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/deployments/{id}/logs","href":"/de/api-reference/deploy/get-a-deployments-captured-comfyui-log"},{"title":"Read whether a deployment serves, and its last worker sample","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/deployments/{id}/status","href":"/de/api-reference/deploy/read-whether-a-deployment-serves-and-its-last-worker-sample"},{"title":"Read a deployment's named metrics over a window","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/deployments/{id}/metrics","href":"/de/api-reference/deploy/read-a-deployments-named-metrics-over-a-window"},{"title":"Start a stopped deployment","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml post /v1/deployments/{id}/start","href":"/de/api-reference/deploy/start-a-stopped-deployment"},{"title":"The deploy ceilings this workspace is held to","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/limits","href":"/de/api-reference/deploy/the-deploy-ceilings-this-workspace-is-held-to"},{"title":"How long a deployment of a release would take to come up","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/deploy-estimate","href":"/de/api-reference/deploy/how-long-a-deployment-of-a-release-would-take-to-come-up"},{"title":"Locations a deployment can run in, the GPUs sold there, and storage pricing","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/compute-catalog","href":"/de/api-reference/deploy/locations-a-deployment-can-run-in-the-gpus-sold-there-and-storage-pricing"},{"title":"Public GPU and storage list prices","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/rate-card","href":"/de/api-reference/deploy/public-gpu-and-storage-list-prices"},{"title":"Serverless spend, grouped and bucketed","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml get /v1/usage/serverless","href":"/de/api-reference/deploy/serverless-spend-grouped-and-bucketed"},{"title":"Stop a deployment","deprecated":null,"version":null,"openapi":"/openapi-deploy.yaml post /v1/deployments/{id}/stop","href":"/de/api-reference/deploy/stop-a-deployment"}]}]}]},{"title":"Nutzung und Limits","sidebarTitle":"Nutzung und Limits","icon":"gauge","href":"/de/development/deploy/cloud-usage"}]},{"group":"Self-Hosting","root":{"title":"ComfyUI selbst hosten: Bare Metal, GPU-Cloud und Docker","sidebarTitle":"Hosting-Optionen","icon":"server","href":"/de/development/deploy/self-hosting"},"pages":[{"title":"ComfyUI selbst hosten: Bare Metal, GPU-Cloud und Docker","sidebarTitle":"Hosting-Optionen","icon":"server","href":"/de/development/deploy/self-hosting"},{"group":"Server API","pages":[{"title":"ComfyUI Server im Überblick: REST- und WebSocket-APIs","sidebarTitle":"Serverüberblick","href":"/de/development/comfyui-server/comms_overview"},{"title":"ComfyUI Server-API-Beispiele: HTTP, WebSocket, History","sidebarTitle":"API-Beispiele","href":"/de/development/comfyui-server/api-examples"},{"title":"ComfyUI-Server-Routen (HTTP- und WebSocket-API)","sidebarTitle":"HTTP- \u0026 WebSocket-Routen","icon":"route","href":"/de/development/comfyui-server/comms_routes"},{"title":"ComfyUI Server-Nachrichten (WebSocket-API)","sidebarTitle":"WebSocket-Nachrichten","icon":"comment","href":"/de/development/comfyui-server/comms_messages"},{"title":"ComfyUI-Startup-Flags: Befehlszeilenreferenz","sidebarTitle":"Startup-Flags","icon":"terminal","href":"/de/development/comfyui-server/startup-flags"},{"title":"API-Schlüssel für das ComfyUI-Konto integrieren","sidebarTitle":"API-Schlüssel-Integration","icon":"puzzle-piece","href":"/de/development/comfyui-server/api-key-integration"}]}]},{"group":"Workflows ausführen","pages":[{"title":"ComfyUI-Workflows ausführen: SDKs und Server-APIs","sidebarTitle":"Übersicht","icon":"play","href":"/de/development/run-workflows/overview"},{"title":"Ihren ersten Workflow ausführen","sidebarTitle":"Erster Workflow","href":"/de/development/api-development/quickstart"},{"title":"Comfy SDKs: Python- und TypeScript-Clients für ComfyUI","sidebarTitle":"SDKs","icon":"code","href":"/de/development/api-development/sdks"},{"title":"API-Proxy für selbst gehostetes ComfyUI","sidebarTitle":"API-Proxy","icon":"plug","href":"/de/development/comfyui-server/api-proxy"},{"title":"ComfyUI Workflow-API-Format: JSON für die API-Übermittlung exportieren","sidebarTitle":"Workflow-API-Format","icon":"file-code","href":"/de/development/api-development/workflow-api-format"},{"title":"Workflow-Metadaten in ComfyUI-Ausgabedateien","sidebarTitle":"Workflow-Metadaten","icon":"file-code","href":"/de/development/api-development/workflow-metadata"},{"group":"Comfy-API-Referenz","boost":10,"pages":[{"title":"Comfy API Versionen: v2 und die veraltete v1 Cloud API","sidebarTitle":"Übersicht","href":"/de/development/comfy-api/overview"},{"group":"v2","pages":[{"title":"Comfy API v2: Überblick","sidebarTitle":"Überblick","href":"/de/api-reference/v2/overview"},{"title":"Comfy API v2: Designnotizen zu Versionierung und Aufträgen","sidebarTitle":"Designnotizen","icon":"compass","href":"/de/development/api-development/sdks-design"},{"group":"API-Referenz","pages":[{"group":"assets","pages":[{"title":"Upload an asset (single-call multipart)","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml post /api/v2/assets","href":"/de/api-reference/v2/assets/upload-an-asset-single-call-multipart"},{"title":"Create or reuse an asset over existing bytes","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml post /api/v2/assets/from-hash","href":"/de/api-reference/v2/assets/create-or-reuse-an-asset-over-existing-bytes"},{"title":"Existence check for a blob by blake3 hash","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml head /api/v2/assets/by-hash/{hash}","href":"/de/api-reference/v2/assets/existence-check-for-a-blob-by-blake3-hash"},{"title":"Asset metadata","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml get /api/v2/assets/{id}","href":"/de/api-reference/v2/assets/asset-metadata"},{"title":"Delete an asset record","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml delete /api/v2/assets/{id}","href":"/de/api-reference/v2/assets/delete-an-asset-record"},{"title":"Asset bytes","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml get /api/v2/assets/{id}/content","href":"/de/api-reference/v2/assets/asset-bytes"}]},{"group":"jobs","pages":[{"title":"List jobs, newest first","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml get /api/v2/jobs","href":"/de/api-reference/v2/jobs/list-jobs-newest-first"},{"title":"Submit a workflow for execution","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml post /api/v2/jobs","href":"/de/api-reference/v2/jobs/submit-a-workflow-for-execution"},{"title":"Job status (the polling workhorse)","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml get /api/v2/jobs/{id}","href":"/de/api-reference/v2/jobs/job-status-the-polling-workhorse"},{"title":"The workflow behind a job — authoring version if pinned, executed graph otherwise","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml get /api/v2/jobs/{id}/workflow","href":"/de/api-reference/v2/jobs/the-workflow-behind-a-job-—-authoring-version-if-pinned-executed-graph-otherwise"},{"title":"What the run printed","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml get /api/v2/jobs/{id}/logs","href":"/de/api-reference/v2/jobs/what-the-run-printed"},{"title":"Live event stream (SSE)","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml get /api/v2/jobs/{id}/events","href":"/de/api-reference/v2/jobs/live-event-stream-sse"},{"title":"Request cancellation","deprecated":null,"version":null,"openapi":"/openapi-v2.yaml post /api/v2/jobs/{id}/cancel","href":"/de/api-reference/v2/jobs/request-cancellation"}]}]}]},{"group":"v1 Cloud API (veraltet)","pages":[{"title":"v1 Cloud API im Überblick","sidebarTitle":"Übersicht","href":"/de/development/cloud/overview"},{"title":"Cloud API-Referenz","sidebarTitle":"Codebeispiele","icon":"book-open","href":"/de/development/cloud/api-reference"},{"title":"OpenAPI-Spezifikation","icon":"file-lines","openapi":"/openapi-cloud.yaml","href":"/de/development/cloud/openapi"},{"group":"Cloud-API-Referenz","pages":[{"group":"workflow","pages":[{"title":"Get information about current prompt executions","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/prompt","href":"/de/api-reference/cloud/workflow/get-information-about-current-prompt-executions"},{"title":"Submit a workflow for execution","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml post /api/prompt","href":"/de/api-reference/cloud/workflow/submit-a-workflow-for-execution"},{"title":"Get available workflow templates","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/workflow_templates","href":"/de/api-reference/cloud/workflow/get-available-workflow-templates"},{"title":"Get available subgraph blueprints","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/global_subgraphs","href":"/de/api-reference/cloud/workflow/get-available-subgraph-blueprints"},{"title":"Get a specific subgraph blueprint","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/global_subgraphs/{id}","href":"/de/api-reference/cloud/workflow/get-a-specific-subgraph-blueprint"}]},{"group":"node","pages":[{"title":"Get all node information","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/object_info","href":"/de/api-reference/cloud/node/get-all-node-information"},{"title":"Get server feature flags","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/features","href":"/de/api-reference/cloud/node/get-server-feature-flags"}]},{"group":"model","pages":[{"title":"Get available model folders","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/experiment/models","href":"/de/api-reference/cloud/model/get-available-model-folders"},{"title":"Get models in a specific folder","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/experiment/models/{folder}","href":"/de/api-reference/cloud/model/get-models-in-a-specific-folder"},{"title":"Get model preview image","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/experiment/models/preview/{folder}/{path_index}/{filename}","href":"/de/api-reference/cloud/model/get-model-preview-image"}]},{"group":"job","pages":[{"title":"Manage execution history","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml post /api/history","href":"/de/api-reference/cloud/job/manage-execution-history"},{"title":"Get execution history (v2)","deprecated":true,"version":null,"openapi":"/openapi-cloud.yaml get /api/history_v2","href":"/de/api-reference/cloud/job/get-execution-history-v2"},{"title":"Get history for specific prompt","deprecated":true,"version":null,"openapi":"/openapi-cloud.yaml get /api/history_v2/{prompt_id}","href":"/de/api-reference/cloud/job/get-history-for-specific-prompt"},{"title":"List jobs with pagination and filtering","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/jobs","href":"/de/api-reference/cloud/job/list-jobs-with-pagination-and-filtering"},{"title":"Get full job details","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/jobs/{job_id}","href":"/de/api-reference/cloud/job/get-full-job-details"},{"title":"Get queue information","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/queue","href":"/de/api-reference/cloud/job/get-queue-information"},{"title":"Manage queue operations","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml post /api/queue","href":"/de/api-reference/cloud/job/manage-queue-operations"},{"title":"Interrupt currently running jobs","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml post /api/interrupt","href":"/de/api-reference/cloud/job/interrupt-currently-running-jobs"},{"title":"Get job status","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/job/{job_id}/status","href":"/de/api-reference/cloud/job/get-job-status"}]},{"group":"file","pages":[{"title":"View a file","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/view","href":"/de/api-reference/cloud/file/view-a-file"},{"title":"Get related mask layer files","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/files/mask-layers","href":"/de/api-reference/cloud/file/get-related-mask-layer-files"},{"title":"Upload an image file","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml post /api/upload/image","href":"/de/api-reference/cloud/file/upload-an-image-file"},{"title":"Upload a mask image","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml post /api/upload/mask","href":"/de/api-reference/cloud/file/upload-a-mask-image"}]},{"group":"asset","pages":[{"title":"List user assets","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/assets","href":"/de/api-reference/cloud/asset/list-user-assets"},{"title":"Upload a new asset","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml post /api/assets","href":"/de/api-reference/cloud/asset/upload-a-new-asset"},{"title":"Create asset reference from existing hash","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml post /api/assets/from-hash","href":"/de/api-reference/cloud/asset/create-asset-reference-from-existing-hash"},{"title":"Get asset metadata from remote URL","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/assets/remote-metadata","href":"/de/api-reference/cloud/asset/get-asset-metadata-from-remote-url"},{"title":"Initiate background download for large files","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml post /api/assets/download","href":"/de/api-reference/cloud/asset/initiate-background-download-for-large-files"},{"title":"Get asset details","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/assets/{id}","href":"/de/api-reference/cloud/asset/get-asset-details"},{"title":"Update asset metadata","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml put /api/assets/{id}","href":"/de/api-reference/cloud/asset/update-asset-metadata"},{"title":"Delete asset","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml delete /api/assets/{id}","href":"/de/api-reference/cloud/asset/delete-asset"},{"title":"Add tags to asset","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml post /api/assets/{id}/tags","href":"/de/api-reference/cloud/asset/add-tags-to-asset"},{"title":"Remove tags from asset","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml delete /api/assets/{id}/tags","href":"/de/api-reference/cloud/asset/remove-tags-from-asset"},{"title":"List all tags","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/tags","href":"/de/api-reference/cloud/asset/list-all-tags"},{"title":"Get tag histogram for filtered assets","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/assets/tags/refine","href":"/de/api-reference/cloud/asset/get-tag-histogram-for-filtered-assets"},{"title":"Check if asset exists by hash","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml head /api/assets/hash/{hash}","href":"/de/api-reference/cloud/asset/check-if-asset-exists-by-hash"}]},{"group":"user","pages":[{"title":"List user data files","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/userdata","href":"/de/api-reference/cloud/user/list-user-data-files"},{"title":"Get user data file","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/userdata/{file}","href":"/de/api-reference/cloud/user/get-user-data-file"},{"title":"Upload or update a user data file","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml post /api/userdata/{file}","href":"/de/api-reference/cloud/user/upload-or-update-a-user-data-file"},{"title":"Delete a user data file","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml delete /api/userdata/{file}","href":"/de/api-reference/cloud/user/delete-a-user-data-file"},{"title":"Get current user information","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/user","href":"/de/api-reference/cloud/user/get-current-user-information"}]},{"group":"system","pages":[{"title":"Get system statistics","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/system_stats","href":"/de/api-reference/cloud/system/get-system-statistics"}]},{"group":"billing","pages":[{"title":"Get workspace usage over time","deprecated":null,"version":null,"openapi":"/openapi-cloud.yaml get /api/billing/usage/timeseries","href":"/de/api-reference/cloud/billing/get-workspace-usage-over-time"}]}]}]}]}]}]},{"group":"Comfy CLI","pages":[{"title":"Erste Schritte mit der Comfy CLI","sidebarTitle":"Loslegen","href":"/de/comfy-cli/getting-started"},{"title":"Referenz für Comfy CLI-Befehle","sidebarTitle":"Befehlsreferenz","href":"/de/comfy-cli/reference"},{"title":"Comfy CLI-Fehlerbehebung: Setup- und Installationsprobleme beheben","sidebarTitle":"Fehlerbehebung","href":"/de/comfy-cli/troubleshooting"}]},{"group":"Spezifikationen","pages":[{"group":"Workflow JSON","pages":[{"title":"Workflow JSON","href":"/de/specs/workflow_json"},{"title":"Workflow JSON 0.4","href":"/de/specs/workflow_json_0.4"}]},{"group":"Node-Definitionen","pages":[{"title":"Node-Definition JSON","href":"/de/specs/nodedef_json"},{"title":"Node-Definition JSON 1.0","href":"/de/specs/nodedef_json_1_0"}]}]},{"group":"Custom Nodes","pages":[{"title":"ComfyUI Custom Nodes entwickeln: erstellen, erweitern und veröffentlichen","sidebarTitle":"Übersicht","href":"/de/custom-nodes/intro"},{"group":"Custom Nodes erstellen","pages":[{"title":"Typen von ComfyUI Custom Nodes und ihre Architektur","sidebarTitle":"Node-Typen","href":"/de/custom-nodes/overview"},{"title":"Custom Nodes in ComfyUI erstellen","sidebarTitle":"Ihren ersten Node erstellen","href":"/de/custom-nodes/walkthrough"},{"group":"Python (Backend)","pages":[{"title":"Eigenschaften von Custom Nodes","sidebarTitle":"Node-Eigenschaften","href":"/de/custom-nodes/backend/server_overview"},{"title":"Lebenszyklus von Custom Nodes in ComfyUI","sidebarTitle":"Node-Lebenszyklus","href":"/de/custom-nodes/backend/lifecycle"},{"title":"Datentypen für ComfyUI Custom Nodes","sidebarTitle":"Datentypen","href":"/de/custom-nodes/backend/datatypes"},{"title":"Bilder, Latents und Masken","sidebarTitle":"Bilder, Latents, Masken","href":"/de/custom-nodes/backend/images_and_masks"},{"title":"Ausgeblendete und flexible Eingänge","sidebarTitle":"Ausgeblendete \u0026 flexible Eingänge","href":"/de/custom-nodes/backend/more_on_inputs"},{"title":"Lazy Evaluation in ComfyUI für Custom Nodes","sidebarTitle":"Lazy Evaluation","href":"/de/custom-nodes/backend/lazy_evaluation"},{"title":"Node-Erweiterung","sidebarTitle":"Node-Erweiterung","href":"/de/custom-nodes/backend/expansion"},{"title":"Datenlisten und Listenverarbeitung in ComfyUI","sidebarTitle":"Listen \u0026 Listenverarbeitung","description":"Wie ComfyUI Daten zwischen Custom Nodes als Python-Listen übergibt: Verpackung bei Länge eins, Listen für Batches und INPUT_IS_LIST/OUTPUT_IS_LIST.","href":"/de/custom-nodes/backend/lists"},{"title":"torch.Tensor in ComfyUI: Formen und Operationen","sidebarTitle":"Tensoren","href":"/de/custom-nodes/backend/tensors"},{"title":"Python-Snippets für ComfyUI Custom Nodes","description":"Kommentierte Codebeispiele für ComfyUI Custom Nodes: Bilder laden und speichern, Masken invertieren, Maskenformen umwandeln und Rauschen erzeugen.","sidebarTitle":"Python-Snippets","href":"/de/custom-nodes/backend/snippets"},{"title":"Leitfaden zur Umkehrung des Ausführungsmodells","sidebarTitle":"Ausführungsmodell","icon":"code-branch","href":"/de/development/comfyui-server/execution_model_inversion_guide"}]},{"group":"JavaScript (UI)","pages":[{"title":"JavaScript-Erweiterungen für den ComfyUI-Webclient","sidebarTitle":"JavaScript-Erweiterungen","href":"/de/custom-nodes/js/javascript_overview"},{"title":"JavaScript-Hooks in ComfyUI","sidebarTitle":"Hooks","href":"/de/custom-nodes/js/javascript_hooks"},{"title":"ComfyUI-Frontend-Objekte: LiteGraph, ComfyApp und ComfyNode","sidebarTitle":"Comfy-Objekte","href":"/de/custom-nodes/js/javascript_objects_and_hijacking"},{"title":"Settings API","sidebarTitle":"Settings API","href":"/de/custom-nodes/js/javascript_settings"},{"title":"ComfyUI Dialog API","sidebarTitle":"Dialog API","href":"/de/custom-nodes/js/javascript_dialog"},{"title":"ComfyUI Toast API","sidebarTitle":"Toast API","href":"/de/custom-nodes/js/javascript_toast"},{"title":"ComfyUI About Panel Badges API","sidebarTitle":"Badges im About-Panel","href":"/de/custom-nodes/js/javascript_about_panel_badges"},{"title":"API für Tabs im unteren Panel von ComfyUI","sidebarTitle":"Tabs im unteren Panel","href":"/de/custom-nodes/js/javascript_bottom_panel_tabs"},{"title":"Tabs in der Seitenleiste","sidebarTitle":"Sidebar-Tabs","href":"/de/custom-nodes/js/javascript_sidebar_tabs"},{"title":"ComfyUI Selection-Toolbox-API","sidebarTitle":"Selection-Toolbox","href":"/de/custom-nodes/js/javascript_selection_toolbox"},{"title":"ComfyUI Commands- und Tastenkürzel-API","sidebarTitle":"Befehle und Tastenkürzel","href":"/de/custom-nodes/js/javascript_commands_keybindings"},{"title":"ComfyUI API für das Menü der oberen Leiste","sidebarTitle":"Menü-API der oberen Leiste","href":"/de/custom-nodes/js/javascript_topbar_menu"},{"title":"ComfyUI Subgraphs","sidebarTitle":"Subgraphs","href":"/de/custom-nodes/js/subgraphs"},{"title":"Canvas-Zeiger-API für Widgets und Cursor","sidebarTitle":"Canvas-Zeiger-API","href":"/de/custom-nodes/js/canvas-pointer-api"},{"title":"JavaScript-Beispiele für Custom Nodes: Menüs, Events und Hooks","sidebarTitle":"JavaScript-Beispiele","href":"/de/custom-nodes/js/javascript_examples"}]},{"title":"ComfyUI Custom Node i18n: Node-Definitionen lokalisieren","sidebarTitle":"i18n-Support","href":"/de/custom-nodes/i18n"},{"group":"Migrationsanleitungen","pages":[{"title":"ComfyUI Custom Node V3-Migration: vom V1- zum V3-Schema","sidebarTitle":"V3-Migration","href":"/de/custom-nodes/v3_migration"},{"title":"ComfyUI-Kontextmenü-API migrieren: Canvas- und Node-Menüs","sidebarTitle":"Kontextmenü migrieren","href":"/de/custom-nodes/js/context-menu-migration"},{"title":"Node-ID-Migration für Frontend-Erweiterungen","sidebarTitle":"Node-ID-Migration","href":"/de/custom-nodes/js/node-id-migration"},{"title":"Migration der Verbindungsregistrierung für Frontend-Erweiterungen","sidebarTitle":"Verbindungsregistrierung","href":"/de/custom-nodes/js/link-registration-migration"},{"title":"Migration des Widget-Systems für Frontend-Erweiterungen","sidebarTitle":"Widget-Systemmigration","href":"/de/custom-nodes/js/widgets-migration"},{"title":"Migration der Connection-Callbacks für Frontend-Erweiterungen","sidebarTitle":"Connection-Callbacks","href":"/de/custom-nodes/js/connection-callbacks-migration"},{"title":"Migration von Serialisierungs-Callbacks für Frontend-Erweiterungen","sidebarTitle":"Serialisierungs-Callbacks","href":"/de/custom-nodes/js/serialization-callbacks-migration"},{"title":"Node-Geometrie-Migration für Frontend-Erweiterungen","sidebarTitle":"Node-Geometrie-Migration","href":"/de/custom-nodes/js/node-geometry-migration"},{"title":"Migration nach der PrimeVue-Entfernung für Frontend-Erweiterungen","sidebarTitle":"PrimeVue-Entfernung","href":"/de/custom-nodes/js/primevue-removal-migration"},{"title":"Node-Ersetzung","sidebarTitle":"Node-Ersetzung","href":"/de/custom-nodes/backend/node-replacement"}]}]},{"group":"Verpacken \u0026 Veröffentlichen","pages":[{"title":"ComfyUI Custom Node-Dokumentation: Markdown-Hilfeseiten","sidebarTitle":"Node-Dokumentation","href":"/de/custom-nodes/help_page"},{"title":"Workflow-Vorlagen","href":"/de/custom-nodes/workflow_templates"},{"title":"Subgraph-Blueprints","href":"/de/custom-nodes/subgraph_blueprints"},{"title":"Comfy Registry: Custom Nodes veröffentlichen und versionieren","sidebarTitle":"Registry-Übersicht","href":"/de/registry/overview"},{"title":"Custom Nodes in der Comfy Registry veröffentlichen","sidebarTitle":"Nodes veröffentlichen","href":"/de/registry/publishing"},{"title":"Einen Custom Node im ComfyUI Manager veröffentlichen","sidebarTitle":"Im Manager veröffentlichen","href":"/de/custom-nodes/backend/manager"},{"title":"Einen Custom Node in der Comfy Registry beanspruchen","sidebarTitle":"Node beanspruchen","href":"/de/registry/claim-my-node"},{"title":"Qualitäts- und Sicherheitsstandards für Nodes im Comfy Registry","sidebarTitle":"Qualität \u0026 Sicherheit","href":"/de/registry/standards"},{"title":"Custom Node CI/CD","sidebarTitle":"CI/CD","href":"/de/registry/cicd"},{"title":"ComfyUI Registry: pyproject.toml-Spezifikation für Custom Nodes","sidebarTitle":"pyproject.toml","href":"/de/registry/specifications"},{"title":"API-Übersicht","href":"/de/registry/api-reference/overview"},{"group":"Registry-API-Referenz","pages":[{"title":"Get information about the calling user.","deprecated":null,"version":null,"openapi":"https://api.comfy.org/openapi get /users","href":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/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":"/de/registry/api-reference/releases/get-release-notes"}]}]}]}]},{"tab":"Rankings","pages":[{"title":"Rankings","href":"/de/rankings"}]},{"tab":"Support","pages":[{"title":"Support","href":"/de/support/contact-support"}]}]},{"language":"ru","pages":[{"title":"ru","href":"/ru/custom-nodes/backend/tensors"}]}]},"basePath":"","title":"torch.Tensor in ComfyUI: Formen und Operationen - ComfyUI","deploymentId":"dpl_XLevHnGPjzxq9mbREha5Faad63Sp","buildId":"dpl_XLevHnGPjzxq9mbREha5Faad63Sp","dynamics":[],"chunks":[]}