xingren23 / comfyflowapp Goto Github PK
View Code? Open in Web Editor NEWFrom comfyui workflow to web app, in seconds
Home Page: https://comfyflow.app
License: GNU General Public License v3.0
From comfyui workflow to web app, in seconds
Home Page: https://comfyflow.app
License: GNU General Public License v3.0
Creating a workflow application website can be challenging for ComfyUI developers.
Developing the workflow is demanding, and getting others to use it is even more so, due to environment setup issues, custom ComfyUI node issues, model downloading problems, among others. With ComfyFlowApp and ComfyUI, creators can easily build their own workflow application websites.
Taking RunPod as an example, this explains how to use ComfyFlowApp and ComfyUI to construct your own workflow application website.
Choose an RTX 3080 Ti with 12GB VRAM as an example. The cost is $0.19 per hour. If we opt for Spot mode, the price drops to $0.15 per hour.
After the instance is launched, you can connect to the RunPod instance using SSH, or access the instance through Jupyter Notebook. The following is an explanation using SSH as an example.
Configure port mapping and modify ports 8888, 8188, 8501.
Changing the mapped ports will cause the server to restart. Content outside the /workspace directory will be lost, so we map the port first.
# enter workspace
cd /workspace
# git clone comfyui
root@bee82bea846d:/workspace# git clone https://github.com/comfyanonymous/ComfyUI
Cloning into 'ComfyUI'...
remote: Enumerating objects: 9222, done.
remote: Counting objects: 100% (2875/2875), done.
remote: Compressing objects: 100% (309/309), done.
remote: Total 9222 (delta 2668), reused 2573 (delta 2565), pack-reused 6347
Receiving objects: 100% (9222/9222), 3.75 MiB | 16.08 MiB/s, done.
Resolving deltas: 100% (6232/6232), done.
# download runway-sd-1.5 from huggingface to models/checkpoints
cd ComfyUI
wget https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors?download=true -O models/checkpoints/v1-5-pruned-emaonly.safetensors
# install comfyui
pip install -r requirements.txt
# start comfyui
root@ec4c6cf781e2:/workspace/ComfyUI# python main.py --listen=0.0.0.0
Total VRAM 12045 MB, total RAM 257901 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3080 Ti : cudaMallocAsync
VAE dtype: torch.bfloat16
Using pytorch cross attention
Starting server
To see the GUI go to: http://0.0.0.0:8188
cd /workspace
# clone comfyflowapp
git clone https://github.com/xingren23/ComfyFlowApp
# install comfyflowapp
cd ComfyFlowApp
pip install -r requirement
# start comfyflowapp
root@ec4c6cf781e2:/workspace/ComfyFlowApp# sh bin/creator_run.sh
/workspace/ComfyFlowApp
Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.
You can now view your Streamlit app in your browser.
Network URL: http://172.24.0.2:8501
External URL: http://194.26.196.133:8501
Check ComfyUI and ComfyFlowApp is alive, click the button to access in public
Gen a image from ComfyUI default workflow, and download image local
感觉未登录状态可以有使用app的权限,但不应该有uninstall的权限。
The sharing of ComfyUI workflows is a challenge because everyone has different operating environments, local models, and extension nodes. Running someone else's workflow always involves a lot of difficulties.
ComfyFlowApp aims to explore a solution to this problem by allowing users to publish their ComfyFlowApp on the web and make it available on app stores. Other users can then download the app and run it locally.
Can be found here:
https://huggingface.co/h94/IP-Adapter-FaceID/tree/main
Common upscalers: 4x Ultrasharp, Remacri, NMKD, etc.
This is the error log
2023-12-13 10:08:27.170 | INFO | main::297 - Loading workspace page
2023-12-13 10:08:27.173 | INFO | modules.page:change_mode_pages:23 - pages: ['Home', 'Workspace', 'My_Apps'], mode: Creator
2023-12-13 10:08:27.178 | INFO | modules.new_app:new_app_ui:480 - Loading create page
2023-12-13 10:08:30.061 | INFO | main::297 - Loading workspace page
2023-12-13 10:08:30.064 | INFO | modules.page:change_mode_pages:23 - pages: ['Home', 'Workspace', 'My_Apps'], mode: Creator
2023-12-13 10:08:30.067 | INFO | modules.new_app:new_app_ui:480 - Loading create page
2023-12-13 10:08:30.069 | INFO | modules.new_app:process_workflow_meta:32 - process_workflow_meta, UploadedFile(file_id='381c2789-65ef-4274-b350-90dba953377b', name='ComfyUI_temp_gxvae_00098_.png', type='image/png', size=535490, _file_urls=file_id: "381c2789-65ef-4274-b350-90dba953377b"
upload_url: "/_stcore/upload_file/b229f049-1a28-4422-ad86-71f3d3ad95e7/381c2789-65ef-4274-b350-90dba953377b"
delete_url: "/_stcore/upload_file/b229f049-1a28-4422-ad86-71f3d3ad95e7/381c2789-65ef-4274-b350-90dba953377b"
)
2023-12-13 10:08:30.092 | WARNING | modules.new_app:parse_prompt:78 - Only support SaveImage as output node, PreviewImage
2023-12-13 10:08:30.135 | WARNING | modules.new_app:parse_prompt:78 - Only support SaveImage as output node, SaveImageExtended
2023-12-13 10:08:30.141 | WARNING | modules.new_app:parse_prompt:78 - Only support SaveImage as output node, PreviewImage
2023-12-13 10:08:30.387 | WARNING | modules.new_app:parse_prompt:78 - Only support SaveImage as output node, PreviewImage
2023-12-13 10:08:30.395 | WARNING | modules.new_app:parse_prompt:78 - Only support SaveImage as output node, PlaySound|pysssss
2023-12-13 10:08:30.402 | WARNING | modules.new_app:parse_prompt:78 - Only support SaveImage as output node, PlaySound|pysssss
2023-12-13 10:08:30.453 | WARNING | modules.new_app:parse_prompt:78 - Only support SaveImage as output node, PreviewImage
2023-12-13 10:08:30.569 | WARNING | modules.new_app:parse_prompt:78 - Only support SaveImage as output node, Seed Everywhere
Comfy is up and running and all seems well, but i get this error nevertheless.
看了一下好像不能直接替换图片,自动生成的图标压缩得厉害,而且变形,多谢。
2024-02-14 15:47:19.643 Uncaught app exception
Traceback (most recent call last):
File "D:\anaconda3\envs\comfyflowapp\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 530, in _run_script
self._session_state.on_script_will_rerun(rerun_data.widget_states)
File "D:\anaconda3\envs\comfyflowapp\Lib\site-packages\streamlit\runtime\state\safe_session_state.py", line 61, in on_script_will_rerun
self._state.on_script_will_rerun(latest_widget_states)
File "D:\anaconda3\envs\comfyflowapp\Lib\site-packages\streamlit\runtime\state\session_state.py", line 500, in on_script_will_rerun
self._call_callbacks()
File "D:\anaconda3\envs\comfyflowapp\Lib\site-packages\streamlit\runtime\state\session_state.py", line 513, in _call_callbacks
self._new_widget_state.call_callback(wid)
File "D:\anaconda3\envs\comfyflowapp\Lib\site-packages\streamlit\runtime\state\session_state.py", line 260, in call_callback
callback(*args, **kwargs)
File "D:\Git\ComfyFlowApp\modules\new_app.py", line 276, in submit_app
app_config = gen_app_config()
^^^^^^^^^^^^^^^^
File "D:\Git\ComfyFlowApp\modules\new_app.py", line 241, in gen_app_config
node_id, param, input_param1_inputs = get_node_input_config(
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Git\ComfyFlowApp\modules\new_app.py", line 155, in get_node_input_config
if isinstance(class_input[param][0], str):
~~~~~~~~~~~^^^^^^^
KeyError: 'upload'
工作流在本地comfyui里运行正常的,
comfyflowapp也安装正常,但创建不成功。报错如上。
The below workflow is works fine in comfyui:
workflow.json
But comfyflowapp can not get the outputs from comfyui after this workflow finished:
2024-03-22 00:32:21.281 | INFO | modules.comfyclient:_websocket_loop:131 - workflow finished, exiting websocket loop
2024-03-22 00:32:21.281 | INFO | modules.comfyclient:get_history:71 - Getting history from server, 5a01f108-d252-4756-961a-9c1ed846a2dc
2024-03-22 00:32:23.315 | WARNING | modules.comfyflow:create_ui:271 - get progress exception, '938'
Just downloaded and tried this project but it fails. Perhaps that is because Flux is not supported yet?
Failed to validate prompt for output 9:
parse workflow from image error, please check up comfyui is alive and can run this workflow.
to the best of my knowledge, some friends have already developed some interesting applications, welcome to show your use case of comfyflowapp in here.
Imagine Rui created a fancy text effect workflow in ComfyUI that had lots of nodes and input options. It was really confusing for people, and they had to be trained on how to use it, and often made mistakes while using it. Then, Rui used ComfyFlowApp to turn it into an app with just two simple options, making it super easy to understand and use.
你好,api服务是否支持自建?
set COMFYFLOW_API_URL=https://api.comfyflow.app
API必须用这个地址吗?
connect to comfyui node error, HTTPConnectionPool(host='localhost', port=8188): Max retries exceeded with url: /object_info (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000028EC094A090>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。'))
The crystools.monitor regularly communicates with comfyui through websocket to obtain the status of CPU, GPU and other resources, like below:
When comfyflowapp communicates with comfyui through websocket, it will receives and outputs many Unknown messages. It is recommended to hide them:
2024-03-22 00:32:06.950 | INFO | modules.comfyclient:upload_image:64 - Uploading image to server, {'subfolder': '', 'type': 'input', 'overwrite': 'true'}
2024-03-22 00:32:07.697 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:08.714 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:09.000 | INFO | modules.comfyclient:queue_remaining:34 - Got remaining from http://localhost:9000/prompt
2024-03-22 00:32:09.734 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:10.744 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:11.753 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:12.772 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:13.785 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:14.794 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:15.813 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:16.819 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:17.823 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:18.839 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:19.847 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:20.868 | WARNING | modules.comfyclient:_websocket_loop:146 - Unknown message type crystools.monitor
2024-03-22 00:32:21.281 | INFO | modules.comfyclient:_websocket_loop:131 - workflow finished, exiting websocket loop2024-03-22 00:32:21.281 | INFO | modules.comfyclient:get_history:71 - Getting history from server, 5a01f108-d252-4756-961a-9c1ed846a2dc
2024-03-22 00:32:23.315 | WARNING | modules.comfyflow:create_ui:271 - get progress exception, '938'
ComfyFlowApp run with integrated comfyui, that has integrated some custom_nodes into the repo.
How can I create more input params when configuring a workflow UI?
OperationalError: (sqlite3.OperationalError) database is locked [SQL: CREATE TABLE IF NOT EXISTS comfyflow_apps (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, description TEXT, image TEXT, app_conf TEXT, api_conf TEXT, template TEXT, url TEXT, status TEXT, created_at TEXT, updated_at TEXT);] (Background on this error at: https://sqlalche.me/e/14/e3q8)
File "C:\comfyflowapp-python-3.11-amd64\python-3.11.7-embed-amd64\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 530, in _run_script
self._session_state.on_script_will_rerun(rerun_data.widget_states)
File "C:\comfyflowapp-python-3.11-amd64\python-3.11.7-embed-amd64\Lib\site-packages\streamlit\runtime\state\safe_session_state.py", line 61, in on_script_will_rerun
self._state.on_script_will_rerun(latest_widget_states)
File "C:\comfyflowapp-python-3.11-amd64\python-3.11.7-embed-amd64\Lib\site-packages\streamlit\runtime\state\session_state.py", line 500, in on_script_will_rerun
self._call_callbacks()
File "C:\comfyflowapp-python-3.11-amd64\python-3.11.7-embed-amd64\Lib\site-packages\streamlit\runtime\state\session_state.py", line 513, in _call_callbacks
self._new_widget_state.call_callback(wid)
File "C:\comfyflowapp-python-3.11-amd64\python-3.11.7-embed-amd64\Lib\site-packages\streamlit\runtime\state\session_state.py", line 260, in call_callback
callback(*args, **kwargs)
File "C:\comfyflowapp-python-3.11-amd64\ComfyFlowApp\modules\new_app.py", line 276, in submit_app
app_config = gen_app_config()
^^^^^^^^^^^^^^^^
File "C:\comfyflowapp-python-3.11-amd64\ComfyFlowApp\modules\new_app.py", line 241, in gen_app_config
node_id, param, input_param1_inputs = get_node_input_config(
^^^^^^^^^^^^^^^^^^^^^^
File "C:\comfyflowapp-python-3.11-amd64\ComfyFlowApp\modules\new_app.py", line 155, in get_node_input_config
if isinstance(class_input[param][0], str):
Hey there!
I've tried your app and it looks really promising!
However, there're some things I don't understand. Can I go public with it? I mean, get a public link to the webapp when I run my workflow?
Edit: I've made a simple workflow with ComfyUI_IPadapter_Plus and ComfyUI_Reactor and Efficiency Nodes (looks like I have to upload the nodes..?)
This document will explain how to share your local ComfyFlowApp with public users through ngrok.
Simply download, extract using 7-Zip, and run it.
Make sure you place your Stable Diffusion checkpoints/models (the large ckpt/safetensors files) in: ComfyUI\models\checkpoints.
Click run_nvidia_gpu.bat to run ComfyUI; the default is http://127.0.0.1:8188/.
Refer to the official installation tutorial for ComfyUI on GitHub at https://github.com/comfyanonymous/ComfyUI.
You can download the integrated package for Windows, comfyflowapp-python-3.11-amd64.7z.
Click run.bat to run ComfyFlowApp; the default is http://127.0.0.1:8501/.
Refer to the official installation tutorial for ComfyFlowApp on GitHub at https://github.com/xingren23/ComfyFlowApp.
Refer to the official ngrok website tutorial at https://dashboard.ngrok.com/get-started/setup/windows.
Download a standalone executable with zero runtime dependencies: ngrok-v3-stable-windows-amd64.
Put your app online with ephemeral domain forwarding to your local port 8188 by running:
ngrok http 8188
Once it's running, your endpoints will be listed on the endpoints page, e.g., https://35d3-2408-8207-2539-a7b0-3988-7bd0-6a4c-2d4e.ngrok-free.app/.
(1) Preview the application locally to test if it's working correctly.
(2) Bind ngrok's endpoint to comfyflow.app
On https://comfyflow.app/, create a ComfyUI Node and activate your access permissions with a key.
(3)Publish the application
Creators can publish the application to the bound endpoint from their local ComfyFlowApp.
为什么我上传基础文生图就能跑,但是我上传其他复杂点的工作流就上传错误,但是我本地的comfyui是可以运行的
ERROR:root:Traceback (most recent call last):
File "E:\IMAGE\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\IMAGE\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\IMAGE\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: MathExpression.evaluate() missing 1 required positional argument: 'extra_pnginfo'
在Creator模式下,上传工作流图片上去的时候,显示图片里没有工作流信息是为什么?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.