diff --git a/sageattention-2.2.0+cu128torch2.7.1-cp312-cp312-win_amd64.whl b/sageattention-2.2.0+cu128torch2.7.1-cp312-cp312-win_amd64.whl new file mode 100644 index 000000000..59b8013b1 Binary files /dev/null and b/sageattention-2.2.0+cu128torch2.7.1-cp312-cp312-win_amd64.whl differ diff --git a/start.bat b/start.bat new file mode 100644 index 000000000..23c6cd668 --- /dev/null +++ b/start.bat @@ -0,0 +1,12 @@ +@echo off +REM Aller dans le dossier du projet +cd /d "C:\Users\benja\Documents\GitHub\ComfyUI triton sageAttention\ComfyUI" + +REM Activer l'environnement virtuel +call venv\Scripts\activate.bat + +REM Afficher un message de confirmation +echo [OK] Environnement virtuel activé. + +REM Lancer ton script Python (change "main.py" si besoin) +python main.py \ No newline at end of file diff --git a/start.ps1 b/start.ps1 new file mode 100644 index 000000000..036f8916e --- /dev/null +++ b/start.ps1 @@ -0,0 +1,3 @@ +$venvPath = “Scripts/Activate.ps1" +. $venvPath +python main.py \ No newline at end of file diff --git a/test.py b/test.py new file mode 100644 index 000000000..b4204fd11 --- /dev/null +++ b/test.py @@ -0,0 +1,27 @@ +import torch +import triton +import triton.language as tl + +@triton.jit +def add_kernel(x_ptr, y_ptr, output_ptr, n_elements, BLOCK_SIZE: tl.constexpr): + pid = tl.program_id(axis=0) + block_start = pid * BLOCK_SIZE + offsets = block_start + tl.arange(0, BLOCK_SIZE) + mask = offsets < n_elements + x = tl.load(x_ptr + offsets, mask=mask) + y = tl.load(y_ptr + offsets, mask=mask) + output = x + y + tl.store(output_ptr + offsets, output, mask=mask) + +def add(x: torch.Tensor, y: torch.Tensor): + output = torch.empty_like(x) + n_elements = output.numel() + grid = lambda meta: (triton.cdiv(n_elements, meta["BLOCK_SIZE"]),) + add_kernel[grid](x, y, output, n_elements, BLOCK_SIZE=1024) + return output + +a = torch.rand(3, device="cuda") +b = a + a +b_compiled = add(a, a) +print(b_compiled - b) +print("If you see tensor([0., 0., 0.], device='cuda:0'), then it works") \ No newline at end of file diff --git a/web/extensions/send_to_button/send_to_button.js b/web/extensions/send_to_button/send_to_button.js new file mode 100644 index 000000000..cc6937768 --- /dev/null +++ b/web/extensions/send_to_button/send_to_button.js @@ -0,0 +1,24 @@ +import { app } from "/scripts/app.js"; + +app.registerExtension({ + name: "SendToLoadImage", + async nodeCreated(node) { + if (node.comfyClass === "SaveImage") { + node.onExecuted = (output) => { + if (!output?.images) return; + + // Crée un bouton une seule fois + if (!node.sendBtn) { + const btn = document.createElement("button"); + btn.innerText = "Send To..."; + btn.style.margin = "5px"; + btn.onclick = () => { + alert("Ici tu pourras choisir vers quel TaggedLoadImage envoyer l’image"); + }; + node.addDOMElement(btn); + node.sendBtn = btn; + } + }; + } + } +});