6 Commits
Author SHA1 Message Date
pixelass 691da6bea7 docs: changelog 2023-08-01 18:57:36 +02:00
pixelass 27eb284229 feat(images): allow copy image 2023-08-01 18:57:07 +02:00
pixelass a43bac17d1 refactor: remove logs 2023-08-01 18:34:17 +02:00
Gregor Adams d0e68a2869 Update README.md 2023-08-01 18:24:00 +02:00
pixelass 72a5d4f8a7 docs: add comfyUI manager instructions 2023-08-01 18:22:59 +02:00
pixelass 4000006366 docs: update readme 2023-08-01 17:59:33 +02:00
5 changed files with 85 additions and 15 deletions
+9
View File
@@ -1,3 +1,12 @@
# [](https://github.com/failfa-st/failfast-comfyui-extensions/compare/v1.3.0...v) (2023-08-01)
### Features
* **images:** allow copy image ([27eb284](https://github.com/failfa-st/failfast-comfyui-extensions/commit/27eb284229235e301496326d22cd3c48e16f6f23))
# [](https://github.com/failfa-st/failfast-comfyui-extensions/compare/v1.0.0...v) (2023-08-01)
+18 -5
View File
@@ -10,6 +10,7 @@ personalization in your ComfyUI environment.
<!-- toc -->
- [Installation](#installation)
* [Load via ComfyUI manager](#load-via-comfyui-manager)
* [Clone Repository](#clone-repository)
* [Download Manually](#download-manually)
- [Update](#update)
@@ -30,10 +31,19 @@ personalization in your ComfyUI environment.
## Installation
Two methods are available for installation:
Three methods are available for installation:
1. Clone the repository directly into the extensions directory.
2. Download the project manually.
1. Load via [ComfyUI manager](https://github.com/ltdrdata/ComfyUI-Manager)
2. Clone the repository directly into the extensions directory.
3. Download the project manually.
### Load via ComfyUI manager
<div align="center">
<img src="https://github.com/failfa-st/failfast-comfyui-extensions/assets/1148334/796aaa99-9b16-4087-bebb-ed8638a8b9fc" alt="ComfyUI manager" >
<p>Install via ComfyUI manager</p>
</div>
### Clone Repository
@@ -138,8 +148,7 @@ The context menu offers additional options for nodes, groups, colors, and the ca
- Custom color option (only available in "default" Color Mode).
- Show title on Reroute node
- Render Reroute as dot
![Screenshot 2023-08-01 164137](
- Copy Images
<div align="center">
@@ -157,6 +166,10 @@ The context menu offers additional options for nodes, groups, colors, and the ca
<p>Reroute as dot</p>
</div>
<div align="center">
<img src="https://github.com/failfa-st/failfast-comfyui-extensions/assets/1148334/f41b4aff-9677-4faf-85cb-86ce497d6240" alt="Copy images" >
<p>Copy Image</p>
</div>
**Groups**
+51
View File
@@ -0,0 +1,51 @@
/**
* Coded with love by Failfa.st
* LICENSE: AGPL 3.0
* https://github.com/failfa-st/failfast-comfyui-extensions/blob/main/LICENSE
*
* Visit https://github.com/failfa-st/failfast-comfyui-extensions for more info
*
* Homepage: https://failfa.st
* GitHub: https://github.com/failfa-st
* Discord: https://discord.com/invite/m3TBB9XEkb
*/
import { app } from "/scripts/app.js";
const imagesName = "Failfast.images";
function copyImageToClipboard(img) {
const canvas = document.createElement("canvas");
canvas.width = img.naturalWidth;
canvas.height = img.naturalHeight;
const context = canvas.getContext("2d");
context.drawImage(img, 0, 0);
canvas.toBlob(function (blob) {
const items = [new ClipboardItem({ "image/png": blob })];
navigator.clipboard.write(items);
});
canvas.remove();
}
app.registerExtension({
name: imagesName,
async init(app) {
const getNodeMenuOptions = LGraphCanvas.prototype.getNodeMenuOptions;
LGraphCanvas.prototype.getNodeMenuOptions = function (node) {
const options = getNodeMenuOptions.apply(this, arguments);
const isImageMenu = options.some(
(option) => option?.content === "Save Image",
);
if (isImageMenu) {
options.splice(2, 0, {
content: "Copy Image",
callback() {
const [img] = node.imgs;
if (img) {
copyImageToClipboard(img);
}
},
});
}
return options;
};
},
});
+5 -9
View File
@@ -12,7 +12,7 @@
import { app } from "/scripts/app.js";
const reroutesName = "Failfast.reroutes";
const mini =[34,26]
const mini = [34, 26];
function miniReroute(node) {
if (node.type !== "Reroute") {
return;
@@ -36,9 +36,7 @@ function miniReroute(node) {
get() {
return this._size;
},
set() {
console.log("prevented");
},
set() {},
});
node._size[0] = mini[0];
node._size[1] = mini[1];
@@ -73,8 +71,8 @@ app.registerExtension({
content: node.properties.showTitle ? "Hide Title" : "Show Title",
callback() {
node.outputs[0].label = node.properties.showTitle
? undefined
: node.title;
? undefined
: node.title;
node.properties.showTitle = !node.properties.showTitle;
},
});
@@ -97,9 +95,7 @@ app.registerExtension({
get() {
return this._size;
},
set() {
console.log("prevented");
},
set() {},
});
}
node._size[0] = node.properties.dot ? 75 : mini[0];
+2 -1
View File
@@ -1,6 +1,7 @@
{
"name": "failfast-comfyui-extensions",
"scripts": {
"changelog": "npx conventional-changelog-cli -p angular -i CHANGELOG.md -s"
"changelog": "npx conventional-changelog-cli -p angular -i CHANGELOG.md -s",
"toc": "npx markdown-toc README.md -i "
}
}