mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-15 21:36:42 +08:00
Add remaining files: web folder, scripts, and dependencies
This commit is contained in:
parent
7e78177f5e
commit
7e597d6eff
BIN
sageattention-2.2.0+cu128torch2.7.1-cp312-cp312-win_amd64.whl
Normal file
BIN
sageattention-2.2.0+cu128torch2.7.1-cp312-cp312-win_amd64.whl
Normal file
Binary file not shown.
12
start.bat
Normal file
12
start.bat
Normal file
@ -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
|
||||
3
start.ps1
Normal file
3
start.ps1
Normal file
@ -0,0 +1,3 @@
|
||||
$venvPath = “Scripts/Activate.ps1"
|
||||
. $venvPath
|
||||
python main.py
|
||||
27
test.py
Normal file
27
test.py
Normal file
@ -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")
|
||||
24
web/extensions/send_to_button/send_to_button.js
vendored
Normal file
24
web/extensions/send_to_button/send_to_button.js
vendored
Normal file
@ -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;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user