Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comfyui #369

Merged
merged 98 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
92883fa
add support to custom comfyui workflow
AbdullahAlfaraj Aug 23, 2023
cc15724
add workflow menu
AbdullahAlfaraj Sep 6, 2023
0987576
add support to LoraLoader node
AbdullahAlfaraj Sep 8, 2023
fc4b125
get valid_nodes definitions from comfy_api config node
AbdullahAlfaraj Sep 14, 2023
7f2f723
refresh button to get comfyui config in case of network failure
AbdullahAlfaraj Sep 15, 2023
56a70af
Merge branch 'master' into comfyui
AbdullahAlfaraj Oct 11, 2023
0ae8bb7
add an option to disabled to SpMenu and SpSliderWithLabel
AbdullahAlfaraj Oct 18, 2023
dda6185
a better approach to loading comfy workflow without the use of specia…
AbdullahAlfaraj Oct 21, 2023
1c81da2
target es2020 to have support for bigint literal
AbdullahAlfaraj Oct 22, 2023
651dcbc
add seed as an input type and allow for it be randomized
AbdullahAlfaraj Oct 22, 2023
899da1e
add filename prefix to output nodes
AbdullahAlfaraj Oct 22, 2023
b69621e
color code the last move node in edit mode
AbdullahAlfaraj Oct 22, 2023
20c4f2a
load gif files into a new project
AbdullahAlfaraj Oct 22, 2023
da44e6a
create temp file with random names
AbdullahAlfaraj Oct 23, 2023
7624b9d
stop loading workflow onComponentDidMount
AbdullahAlfaraj Oct 27, 2023
d3d928c
read all comfyui workflows from native_workflows directory
AbdullahAlfaraj Oct 27, 2023
2648d65
skip any node's input that is linked to prev node
AbdullahAlfaraj Oct 27, 2023
030ffff
extract the image format from a dataUrl or a filename
AbdullahAlfaraj Oct 27, 2023
a80f2ca
hide Skip type input
AbdullahAlfaraj Oct 27, 2023
6ce3711
Group all output PNG and GIF images as Base64 URLs into a single list…
AbdullahAlfaraj Oct 27, 2023
baa26fd
Render output node like other nodes, but include Grid and thumbnail s…
AbdullahAlfaraj Oct 27, 2023
85e5de7
Always include 4 units of maskBlur to prevent poor inpainting output …
AbdullahAlfaraj Oct 27, 2023
321d448
Remove unnecessary commented code.
AbdullahAlfaraj Oct 27, 2023
91e0830
Allow empty inpainting controlnet init image
AbdullahAlfaraj Oct 27, 2023
67f3af2
add support to boolean input type
AbdullahAlfaraj Nov 1, 2023
d438922
make selection optional
AbdullahAlfaraj Nov 4, 2023
f953499
Add an option to retrieve image from canvas in original dimensions
AbdullahAlfaraj Nov 4, 2023
bad16fc
Add a refresh button if a component failed to render.
AbdullahAlfaraj Nov 4, 2023
71d3dcd
Fix bug: Ensure thumbnail click event triggers only once
AbdullahAlfaraj Nov 4, 2023
ec0f257
rename file main.tsx to vae.tsx
AbdullahAlfaraj Nov 4, 2023
747a006
Ensure models always contain array of model names
AbdullahAlfaraj Nov 4, 2023
01676ed
Ensure sampler_list always contain array of sampler names
AbdullahAlfaraj Nov 4, 2023
6182c92
Add option to switch backend between `Automatic1111` and `ComfyUI`
AbdullahAlfaraj Nov 4, 2023
e8ba3f0
Add uploadImage method for uploading videos and images to ComfyUI inp…
AbdullahAlfaraj Nov 4, 2023
048f221
Implement preview display for special nodes LoadImage and LoadVideo
AbdullahAlfaraj Nov 4, 2023
5d6c786
Refactor comfyui.tsx
AbdullahAlfaraj Nov 4, 2023
a5b133d
Render all node inputs prior to treating the node as a special type
AbdullahAlfaraj Nov 4, 2023
e5c63ec
color the border of output nodes
AbdullahAlfaraj Nov 4, 2023
5b1a502
Generate random seeds prior to image request
AbdullahAlfaraj Nov 4, 2023
fe42e8e
add support for comfyapi
AbdullahAlfaraj Nov 4, 2023
19a0a6c
Integrate ComfyUI support in txt2img mode
AbdullahAlfaraj Nov 4, 2023
0d994e1
remove width and height data from native presets
AbdullahAlfaraj Nov 4, 2023
0b72bc7
move custom workflows
AbdullahAlfaraj Nov 13, 2023
4fd73c7
temperately disable refreshUI when ui crash
AbdullahAlfaraj Nov 13, 2023
0a3d8da
delete old code
AbdullahAlfaraj Nov 13, 2023
ce73dd8
develop a new searchable menu component
AbdullahAlfaraj Nov 16, 2023
25505bc
Use session rb_mode if defined, else use interface rb_mode.
AbdullahAlfaraj Nov 16, 2023
4b118a2
upgrade get request to accept different content type
AbdullahAlfaraj Nov 16, 2023
a75b31f
set session rb_mode to txt2img mode
AbdullahAlfaraj Nov 16, 2023
1570267
expand the implementation of comfyapi
AbdullahAlfaraj Nov 16, 2023
3dc8950
delete old code
AbdullahAlfaraj Nov 16, 2023
5056f6c
add support to comfy img2img, inpaint and outpaint
AbdullahAlfaraj Nov 16, 2023
0355f68
Replace ControlNet’s Models and Modules menus with searchable ones.
AbdullahAlfaraj Nov 16, 2023
f31ce1a
Switch LoRa, Embedding, and SD Models menus to searchable ones.
AbdullahAlfaraj Nov 16, 2023
e6ca6b2
Initialize interface with data from the appropriate backend.
AbdullahAlfaraj Nov 16, 2023
f11b67e
generate images using the appropriate backend.
AbdullahAlfaraj Nov 16, 2023
3620e16
Localize the label of generate button
AbdullahAlfaraj Nov 16, 2023
48f5d58
Searchable menu resets store if item doesn’t exist.
AbdullahAlfaraj Nov 16, 2023
a4b60e4
Remove extra padding from the right of the main menu for better styli…
AbdullahAlfaraj Nov 16, 2023
f8b8dcd
update the comfy url on change
AbdullahAlfaraj Nov 16, 2023
011fd54
Restore last used seed in comfyui
AbdullahAlfaraj Nov 17, 2023
c113753
Store `comfy_url` in Photoshop local storage
AbdullahAlfaraj Nov 18, 2023
3fd3a4f
Display error to the user if comfyui api failed to get object info
AbdullahAlfaraj Nov 19, 2023
8d73846
enable hires fix in all comfyui modes
AbdullahAlfaraj Nov 19, 2023
32e775c
support batch size in inpaint mode
AbdullahAlfaraj Nov 19, 2023
b611e09
reuse uploaded images and only upload if it's a new image
AbdullahAlfaraj Nov 19, 2023
5356c36
display comfyui generation error to the user
AbdullahAlfaraj Nov 19, 2023
61a890f
disable fill and latent_nothing content mask in comfyui
AbdullahAlfaraj Nov 19, 2023
b07d29b
set default value of content mask to original
AbdullahAlfaraj Nov 19, 2023
82f78d1
separate preprocessor images outputs from history result
AbdullahAlfaraj Nov 20, 2023
c6c7c9a
Save the comfy output and metadata to the plugin data directory
AbdullahAlfaraj Nov 21, 2023
0a6d412
Fixed auto image issue in control net and txt2img modes while using c…
AbdullahAlfaraj Nov 21, 2023
f039b38
Added option in lasso inpaint to maintain original selection ratio in…
AbdullahAlfaraj Nov 21, 2023
78a6aab
add support to `threshold_a` and `threshold_b` in comfyui backend
AbdullahAlfaraj Nov 22, 2023
f81b8a6
add support to clip skip to comfyui backend
AbdullahAlfaraj Nov 23, 2023
5f7e94c
update the custom workflow
AbdullahAlfaraj Nov 26, 2023
74c70fa
store the selected backend in photoshop local storage
AbdullahAlfaraj Nov 26, 2023
36e4db0
fix: processOutput should be called in both controlnet and normal mode
AbdullahAlfaraj Nov 26, 2023
781d5a2
disable automatic1111 notification when using comfyui backend
AbdullahAlfaraj Nov 26, 2023
3104aed
lower hr_denoising strength value to 0.5
AbdullahAlfaraj Nov 26, 2023
75da62d
return gif outputs as url instead of base64url
AbdullahAlfaraj Nov 26, 2023
a50c20a
fix bug: use `cfg_scale` key instead for `cfg`
AbdullahAlfaraj Nov 26, 2023
82e32c5
override model and module values with `None` if the unit is disabled
AbdullahAlfaraj Nov 26, 2023
95b6313
show an error if the custom node is missing
AbdullahAlfaraj Nov 26, 2023
2c939de
add a thumbnail button to place an image in the selection area
AbdullahAlfaraj Nov 26, 2023
c651430
fix: change status of sp-checkbox by using checked instead of value
AbdullahAlfaraj Nov 26, 2023
b8db7c8
add a button to interrupt generation of custom workflow
AbdullahAlfaraj Nov 26, 2023
4f29542
add: reset workflow button
AbdullahAlfaraj Nov 26, 2023
9159ebe
update inpaint workflow
AbdullahAlfaraj Nov 26, 2023
cc5a892
throw an error comfyui is offline
AbdullahAlfaraj Nov 27, 2023
4e8cb7e
add ip adapter custom workflow examples
AbdullahAlfaraj Nov 27, 2023
de6f73e
parse float input to either slider or textfield ui element
AbdullahAlfaraj Nov 27, 2023
5c14849
Added support for `noise_seed` as an alternative name for the seed field
AbdullahAlfaraj Nov 27, 2023
f514120
remove `Integer` node associated with width and height values
AbdullahAlfaraj Nov 28, 2023
76e8ce5
Updated missed element to use `Locale` for UI labels
AbdullahAlfaraj Nov 28, 2023
0d732eb
Reset element to ‘None’ for invalid items in ControlNet searchable menus
AbdullahAlfaraj Nov 28, 2023
ddde1b3
Show errors on generation failure with ComfyUI backend
AbdullahAlfaraj Nov 28, 2023
2ebd9e4
Updated: ‘Reload Custom Script’ button now uses latest object_Info fr…
AbdullahAlfaraj Nov 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions i18n/zh_CN/ps-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
"Select Lora": "选择 Lora",
"use lora in your prompt": "在提示中使用 lora",
"Generate": "生成",
"Generate txt2img": "生成 txt2img",
"Generate Txt2Img": "生成 Txt2Img",
"Generate Img2Img": "生成 Img2Img",
"Generate Inpaint": "生成 Inpaint",
"Generate Outpaint": "生成 Outpaint",
"outpaint": "outpaint",
"Progress...": "进度...",
"Toggle the visibility of the Preview Image on the canvas": "切换画布上预览图像的可见性",
"Move and reSize the highlighted layer to fit into the Selection Area": "移动和调整突出显示的图层以适合选择区域",
Expand Down Expand Up @@ -67,6 +71,7 @@
"Random": "随机",
"Last": "最后",
"Show Samplers": "显示采样器",
"Sampling Steps:": "Sampling Steps:",
"Select A Script": "选择脚本",
"Activate": "激活",
"Viewer": "查看器",
Expand Down Expand Up @@ -181,4 +186,4 @@
"Delete all generated images from the canvas": "在画布上删除所有生成图像",
"Keep only the highlighted images": "在画布上保留选中的图像",
"Generate More": "生成更多"
}
}
43 changes: 42 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
/* display: none; */
flex: 1 1 auto;
/* overflow: scroll; */
overflow-y: scroll;
/* overflow-y: scroll; */
padding: 12px 0;
flex-direction: column;
}
Expand Down Expand Up @@ -721,6 +721,43 @@
}
</style>

<!-- searchable menu CSS -->
<style>
#mySearch {
width: 100%;
font-size: 18px;
padding: 5px;
color: white;
background-color: #222;
font-weight: bold;
}
#mySearch:focus {
border: 1px solid;
border-color: #7a97e4;
}
#myMenu {
list-style-type: none;
padding: 0;
margin: 0;
max-height: 150px;
overflow-y: scroll;
background-color: #222;
}
#myMenu li {
color: white;
}
#myMenu li a {
padding: 12px;
text-decoration: none;
color: white;
display: block;
font-weight: bold;
}
#myMenu li a:hover {
background-color: #333;
}
</style>

<body>
<!-- <sp-textarea id="tool_tip" open placement="top">use this when you want to fill empty areas of the canvas</sp-textarea> -->
<!-- <sp-tooltip id="tool_tip" open placement="top">use this when you want to fill empty areas of the canvas</sp-tooltip> -->
Expand Down Expand Up @@ -1161,6 +1198,9 @@
<div id="PresetTabContainer"></div>
<sp-divider class="line-divider" size="large"></sp-divider>
<sp-divider class="line-divider" size="large"></sp-divider>
<div id="ComfyUIContainer"></div>
<sp-divider class="line-divider" size="large"></sp-divider>
<sp-divider class="line-divider" size="large"></sp-divider>
</div>
</div>
</div>
Expand All @@ -1182,6 +1222,7 @@
<div class="lexicaContainer"></div>
<sp-divider class="line-divider" size="large"></sp-divider>
<sp-divider class="line-divider" size="large"></sp-divider>
<!-- <div id="ComfyUIContainer"></div> -->
</div>
</uxp-panel>

Expand Down
18 changes: 13 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const {
logger,
toJS,
viewer,
viewer_util,
preview,
// session_ts,
session_store,
Expand All @@ -93,6 +94,11 @@ const {
stores,
lexica,
api_ts,
comfyui,
comfyui_util,
comfyui_main_ui,

comfyapi,
} = require('./typescripts/dist/bundle')

const io = require('./utility/io')
Expand Down Expand Up @@ -532,8 +538,6 @@ let g_selection = {}
let g_b_use_smart_object = true // true to keep layer as smart objects, false to rasterize them
let g_sd_options_obj = new sd_options.SdOptions()

g_sd_options_obj.getOptions()

let g_controlnet_max_models

let g_generation_session = new session.GenerationSession(0) //session manager
Expand Down Expand Up @@ -1795,9 +1799,13 @@ async function openFileFromUrl(url, format = 'gif') {

// Save the image to a temporary file
const tempFolder = await storage.localFileSystem.getTemporaryFolder()
const tempFile = await tempFolder.createFile(`temp.${format}`, {
overwrite: true,
})
const randomNumber = Math.floor(Math.random() * 1000000000) // generates a random number between 0 and 999999999
const tempFile = await tempFolder.createFile(
`temp_${randomNumber}.${format}`,
{
overwrite: true,
}
)
await tempFile.write(arrayBuffer)

// Open the file in Photoshop
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@babel/plugin-transform-react-jsx": "^7.21.5",
"@svgr/webpack": "^8.0.1",
"babel-loader": "^9.1.2",
"chalk": "^5.3.0",
"clean-webpack-plugin": "^4.0.0",
"commander": "^11.0.0",
"copy-webpack-plugin": "^11.0.0",
Expand All @@ -45,7 +46,6 @@
"url-loader": "^4.1.1",
"webpack": "^5.82.1",
"webpack-cli": "^5.1.1",
"chalk": "^5.3.0",
"yazl": "^2.5.1"
},
"scripts": {
Expand All @@ -64,4 +64,4 @@
"url": "https://github.com/AbdullahAlfaraj/Auto-Photoshop-StableDiffusion-Plugin/issues"
},
"homepage": "https://github.com/AbdullahAlfaraj/Auto-Photoshop-StableDiffusion-Plugin#readme"
}
}
15 changes: 3 additions & 12 deletions presets/img2img.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"batch_size": 1,
"batch_count": 1,
"steps": 20,
"width": 512,
"height": 512,

"ratio": 1,
"cfg": 7,
"b_width_height_link": true,
Expand All @@ -28,13 +27,5 @@
"hr_upscaler": "",
"selection_mode": "ratio"
},
"controlnet_tab_preset": [
{},
{},
{},
{},
{},
{},
{}
]
}
"controlnet_tab_preset": [{}, {}, {}, {}, {}, {}, {}]
}
14 changes: 2 additions & 12 deletions presets/inpaint.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"batch_size": 1,
"batch_count": 1,
"steps": 20,
"width": 512,
"height": 512,
"ratio": 1,
"cfg": 7,
"b_width_height_link": true,
Expand All @@ -28,13 +26,5 @@
"hr_upscaler": "",
"selection_mode": "ratio"
},
"controlnet_tab_preset": [
{},
{},
{},
{},
{},
{},
{}
]
}
"controlnet_tab_preset": [{}, {}, {}, {}, {}, {}, {}]
}
Loading