@@CodeCraftersCorner hello again, I've made some major breakthroughs with ComfyUI since my first comment, I'm currently developing a workflow to be used in API format with React as front-end for a mobile app, do you have any experience creating UIs with React and are their similar principles involved as the Gradio/Python example you've wonderfully demonstrated ?
Thanks for this. Been trying to find a low profile but extensible system for accessing my comfy workflows remotely on mobile devices and this method is the one I'm going with. Cheers
26:29 So STrange! I also got my firest image (in this exact step) CUT and have only a part of it. then next images it gets fixed, but why here we got the same thing?
That's is a problem on the Gradio side. Sometimes, the images will not load completely in the browser even with high internet speed. You can replicate the partial image loading bug by trying to load a big image (especially after doing a 4x upscale).
I am glad you found the video helpful. It's awesome that you are working on something similar with streamlit. Thanks for the sub. If you ever have questions or want to share your progress, feel free to reach out. Happy Coding!
You're very welcome. I'm glad the tutorial was helpful in solving what you intended to do. If you have more questions or topics you'd like me to cover, feel free to let me know. Have a fantastic day!
Your content is AMAZING! You just have a new subscriber! Your presentation skills are really top notch. It's rarely to have someone explain so clearly nowadays. I have a workflow that needs to be converted into a Gradio UI, do you work paid gigs?
Since the backend is using ComfyUI, this approach does not work. If your backend is Forge or automatic 1111, yes. ComfyUI has a different implementation.
Thank you for the instant subscribe and like! I am glad the video was helpful. If there is anything specify you like to see in future videos, feel free to let me know. Happy coding!
Thank you so much for the video. It is very useful. I am having one doubt, in real time comfyui server is running in somewhere else, how we can get the outputs from comfyui output directory
Thank you for watching! I have made a follow up video on how to use websockets to get the images. This version will keep track of the request ids, allowing for multiple users to use at the same time and correctly sending the output images to the user. You can see this series here: ruclips.net/video/kmZqoLJ2Dhk/видео.html. There's a part 2 and 3 as well.
Thank you for this video, I did as you said, It works well but Everytime my models loading in queue prompt process, Cant we pass ? btw I am new in ComfyUI I dont change models I just send prompts.
Thank you for watching, @AmerikaMeraklisi-yr2xe! The model should load once for the first image generation. After that, as long as you do not manually change it and you have enough system RAM, it will stay in memory. Actually, ComfyUI managers the model. The python app just sends the JSON data to ComfyUI. Unfortunately, we cannot just send prompts.
@@CodeCraftersCorner Thank you so much for reply, My another question When we do this on public server for example google colab How can I get image files to my pc, I have to request get but where ?
@AmerikaMeraklisi-yr2xe, Here is a breakdown of the steps: 1. Create a link or download endpoint. This can be done with a framework like Flask. 2. You can then get all images from the server's folder. 3. At this point, you can display them in a user friendly interface and provide a download button for each or simply download all of them. If it is a personal project, then you can download the images directly from the Gradio app by right clicking on the image and choose save image. (may be slightly different depending on the browser). Gradio also provides a download image button and link. It should be around the top right corner of the output image.
@AmerikaMeraklisi-yr2xe If the Gradio application is running locally on your machine, then you can use the Python Pillow library to save the image to your disk. However, if the app is running on a server, then you will have to manually download the images. Here is the link to the Pillow library: bit.ly/47VOQCc
Thank you, @MyDigitalHub, for the suggestion! While I don't have a paintbrush feature directly in this workflow, Gradio has an ImageEditor component which allows editing uploaded images when used as an input field. You can find more information in the official guide here: bit.ly/4ayH8kh. Hope this helps.
Stable Diffusion Forge uses Gradio too. So you can use the Gradio API with it. The code will be the same. Instead of connecting to ComfyUI, you will connect the the Gradio API
@@CodeCraftersCorner Great. another question : if I had connect from the exterior (allow external APIs) and haev gradio on MY PC. Is there a way to put in a place an authentification, i mean not just a certain IP or certain device, but actually only allow someone who "id"ed himself (like user/password), otherwise the message would not be sent to the pc or at least it would be blocked and no generation happening. ?
The project you explain in your video is very interesting. The only limitation I see is that you can only run the solution in LOCAL mode. Is there an option to deploy to a hosting service that supports Python, Gradio and GPU?
Thank you, @fernandodiaz8231! Yes, you can host ComfyUI on a server and set it up to get a public URL instead of the localhost one. Similarly, you can use Gradio public URL and the code will still works.
Hey, when I am applying same thing on my workflow I am just getting "Running on anaother tab" on progress bar and nothing is happening. Please please Help!!!!!!
Can you check if ComfyUI is generating the image from the terminal? It is possible that your application is stuck in an endless loop. Try to look into the while loop, you can add print statements or any other way to debug it. The running in another tab is normal when you have more than 1 tab with ComfyUI open.
I cannot say for certain, @the_one_and_carpool! While I'm not familiar with deepdream, if it follows the input > process > output structure, creating a Gradio application should be possible. If the underlying workflow has multiple steps, consider adding buttons for each step or utilize Gradio tabs to keep things organized. Additionally, we have to consider whether making a standalone application or connecting the Gradio application with an API.
@@CodeCraftersCorner yes, i mean that it is possible to build a very customized node with new widgets as user interface using JS. anyway, your videos are very good!
Hello Sharvin, is there anyway to check the network setting on gradio to see what information was sent via payload to the API (that generated the image)? I am trying to increment the seed in python so I can generate new images on every click generate action.
Hello Mehrad, yes, you can use your browser's developer's tool to check the network activities. This will give you the payload which Gradio is sending to the backend. This does not show you what is sent to ComfyUI. I have added a new file to the Github repo (link in video description). The file is called "example_with_random_seed.py" where you can take a look at how to manipulate the seed. You will need line 4 and 38. Make sure to change "3" to your node ID number.
Thank you, I took a look - I just used 'prompt["3"]["inputs"]["seed"] += 1'. Do you do any tutoring, I can pay you for pair programming.@@CodeCraftersCorner
Hello Sir! Your tutorials are amazing! I used comfyUI quite a lot and am very comfortable using it. This tutorial is next on my list but I also have a question. Is it possible to basically do the same thing but with a Mobile Application? I'm planning to create a simple yet fun Image worflow and would like to release it as a Mobile app. Would that be possible and if so, could you tell me what I would have to learn to get to that point?
Thank you, @beatemero6718. Yes, you can. At the end of the video, I show how to use the app on mobile. If you are making a native application, you will need to make you own ComfyUI API depending on the workflow used.
thanks, it very helpful but its gradio only work for 72h so how we make them available for 24*7 on the web, basically I want to make the web application so it should be accessed by anyone and any time on the web
Thanks for watching. Yes, when using gradio's public URL, there is a time limit restriction. You can look into setting up your own Share Server on your own cloud server to overcome this restriction. here is a great resource for sharing gradio app: bit.ly/3TQqjK7
Hi @fintech1378! If you do not want to use the API, then you will have to implement the image generation with stable diffusion pipeline from HuggingFace. Of course, you will require handling tokenizing the text, loading and converting images to tensors and passing them over to the pipeline. Note that, you will not get the benefit of optimal loading of models that ComfyUI provide out to the box. That will have to be implemented manually. It is possible but too time consuming. If you are planning on doing everything from scratch, check out the documentation on HuggingFace website.
Thank you for this tutorial, it's super clear! Your approach is very interesting, you are sending the entire workflow json each time in a new payload. I never thought of doing it that way. I will be using radio buttons to basically assemble many parts of a complete prompt - so I will be changing the positive prompt in the json each time. I have a question however - I do plan to run this on cloud GPU's, I suppose I will need to select a service provider which let's me manage the storage/file system if I am to wrangle the output images. ps: I sent you an email offering some freelance work if you're open to it. Thanks again.
Hello @mrleotheo! when you use share=True, you will get two URLs in the terminal. One is localhost and the other is a public URL provided by Gradio. If you want to use your public ip address, you will need to do additional setup. You can check the Gradio official documentation for that.
@@CodeCraftersCorner thank you, I just try to sharing demo like in your video, but it doesn't work. Only white screen. If I add prevent_thread_lock=True - it shows "Killing tunnel"
Hello Sharvin, I don't know if my comment keeps getting deleted or I can't see it, anyway, I was wondering if you offer pair programming/tutor services. I am looking for 4 hours/twice a week, it would amount to $120/week, but I can negotiate if you are interested. You are an excellent teacher, would love to discuss further.
Hello Mehrad, Thank you so much for your kind words. I'm open to discussing the details further. Could you please send me an email at CodeCraftersCorner@gmail.com, so we can discuss the details; schedule, pricing, and any other specific requirements you may have.
Thanks for making this! Extremely clear on how to connect a frontend to ComfyUI.
Glad it was helpful!
DUde all your videos is very informative. Best Tutorials Online
Thank you! Glad you like them!
First time I learn how to use the ComfyUI API, thank you sir!
Happy to help, @jeantimex!
This is exactly what I was looking for, thank you for your clear step-by-step help.
Glad it was helpful, @stevietee3878!
@@CodeCraftersCorner hello again, I've made some major breakthroughs with ComfyUI since my first comment, I'm currently developing a workflow to be used in API format with React as front-end for a mobile app, do you have any experience creating UIs with React and are their similar principles involved as the Gradio/Python example you've wonderfully demonstrated ?
@stevietee3878 No sorry.
Managed to whip up a little Python app, with your help. Thanks!
Thank you, @MrLiamash3! Glad I was able to help!
Thanks for this. Been trying to find a low profile but extensible system for accessing my comfy workflows remotely on mobile devices and this method is the one I'm going with. Cheers
Glad you found the method helpful, @sirflimflam!
26:29 So STrange! I also got my firest image (in this exact step) CUT and have only a part of it. then next images it gets fixed, but why here we got the same thing?
That's is a problem on the Gradio side. Sometimes, the images will not load completely in the browser even with high internet speed. You can replicate the partial image loading bug by trying to load a big image (especially after doing a 4x upscale).
Man I was working on something like this but for the streamlit library. Spot on man instant sub from me 🎉
I am glad you found the video helpful. It's awesome that you are working on something similar with streamlit. Thanks for the sub. If you ever have questions or want to share your progress, feel free to reach out. Happy Coding!
Great job brother
Thank you, @MyDigitalHub! Appreciate the kind words.
Thank you. Your lesson is very clear
Glad it was helpful!
Thank you so much man, the session was very insightful and I was able to solve what I was intending to do. Good day.
You're very welcome. I'm glad the tutorial was helpful in solving what you intended to do. If you have more questions or topics you'd like me to cover, feel free to let me know. Have a fantastic day!
Your content is AMAZING! You just have a new subscriber! Your presentation skills are really top notch. It's rarely to have someone explain so clearly nowadays.
I have a workflow that needs to be converted into a Gradio UI, do you work paid gigs?
Thank you very much, @StringerBell! Yes, you can contact me by using this email address to discuss the projects: CodeCraftersCorner@gmail.com
@@CodeCraftersCorner done, I sent you an email
@@CodeCraftersCorner Hey did you happen to receive my email? I sent you the details couple of hours ago but I'm not sure if you received the workflow.
Yes, i received it and replied back. Thank you.
I love you so macht S2, u are a genius
Thank you , @PEDROMATOSFAST!
15:22 "seed = -1" not resolve prblm ?
Since the backend is using ComfyUI, this approach does not work. If your backend is Forge or automatic 1111, yes. ComfyUI has a different implementation.
Thank you so much for doing this. Instant subscribe and like!
Thank you for the instant subscribe and like! I am glad the video was helpful. If there is anything specify you like to see in future videos, feel free to let me know. Happy coding!
Thank you so much for the video. It is very useful. I am having one doubt, in real time comfyui server is running in somewhere else, how we can get the outputs from comfyui output directory
Thank you for watching! I have made a follow up video on how to use websockets to get the images. This version will keep track of the request ids, allowing for multiple users to use at the same time and correctly sending the output images to the user. You can see this series here: ruclips.net/video/kmZqoLJ2Dhk/видео.html. There's a part 2 and 3 as well.
Thanks so much for this
Thank you for watching!
Thank you for this video, I did as you said, It works well but Everytime my models loading in queue prompt process, Cant we pass ? btw I am new in ComfyUI I dont change models I just send prompts.
Thank you for watching, @AmerikaMeraklisi-yr2xe! The model should load once for the first image generation. After that, as long as you do not manually change it and you have enough system RAM, it will stay in memory. Actually, ComfyUI managers the model. The python app just sends the JSON data to ComfyUI. Unfortunately, we cannot just send prompts.
@@CodeCraftersCorner Thank you so much for reply, My another question When we do this on public server for example google colab How can I get image files to my pc, I have to request get but where ?
@AmerikaMeraklisi-yr2xe, Here is a breakdown of the steps:
1. Create a link or download endpoint. This can be done with a framework like Flask.
2. You can then get all images from the server's folder.
3. At this point, you can display them in a user friendly interface and provide a download button for each or simply download all of them.
If it is a personal project, then you can download the images directly from the Gradio app by right clicking on the image and choose save image. (may be slightly different depending on the browser).
Gradio also provides a download image button and link. It should be around the top right corner of the output image.
@@CodeCraftersCorner Actually I want to automatıcally download when comfyui finished every que, so download image one by one.
@AmerikaMeraklisi-yr2xe If the Gradio application is running locally on your machine, then you can use the Python Pillow library to save the image to your disk. However, if the app is running on a server, then you will have to manually download the images.
Here is the link to the Pillow library: bit.ly/47VOQCc
Can you add paintbrush feature next? Thanks
Thank you, @MyDigitalHub, for the suggestion! While I don't have a paintbrush feature directly in this workflow, Gradio has an ImageEditor component which allows editing uploaded images when used as an input field. You can find more information in the official guide here: bit.ly/4ayH8kh. Hope this helps.
Great thx. You are my lifesaver!😁
Glad to hear that!
is there a way to implement FORGE UI instead? I heard it uses even LESS vram
Stable Diffusion Forge uses Gradio too. So you can use the Gradio API with it. The code will be the same. Instead of connecting to ComfyUI, you will connect the the Gradio API
@@CodeCraftersCorner Great. another question : if I had connect from the exterior (allow external APIs) and haev gradio on MY PC. Is there a way to put in a place an authentification, i mean not just a certain IP or certain device, but actually only allow someone who "id"ed himself (like user/password), otherwise the message would not be sent to the pc or at least it would be blocked and no generation happening.
?
Very helpful, thanks
Did you try to get the result image via websocket?
Yes, websocket works as well and can retrieve the intermediate images like preview image nodes.
@@CodeCraftersCorner
Nice , can you make a tutorial about that?
i see many people asked about it
Hello, I made the tutorial. Here is the link: ruclips.net/video/kmZqoLJ2Dhk/видео.html
@@CodeCraftersCorner
Thank you very much
👍
The project you explain in your video is very interesting. The only limitation I see is that you can only run the solution in LOCAL mode. Is there an option to deploy to a hosting service that supports Python, Gradio and GPU?
Thank you, @fernandodiaz8231! Yes, you can host ComfyUI on a server and set it up to get a public URL instead of the localhost one. Similarly, you can use Gradio public URL and the code will still works.
Hey, when I am applying same thing on my workflow I am just getting "Running on anaother tab" on progress bar and nothing is happening. Please please Help!!!!!!
Can you check if ComfyUI is generating the image from the terminal? It is possible that your application is stuck in an endless loop. Try to look into the while loop, you can add print statements or any other way to debug it. The running in another tab is normal when you have more than 1 tab with ComfyUI open.
do you think it possible to make a deepdream gradio
I cannot say for certain, @the_one_and_carpool! While I'm not familiar with deepdream, if it follows the input > process > output structure, creating a Gradio application should be possible. If the underlying workflow has multiple steps, consider adding buttons for each step or utilize Gradio tabs to keep things organized. Additionally, we have to consider whether making a standalone application or connecting the Gradio application with an API.
Very nice! i am wondering if this is also possible directly from ComfyUI JS ?
Yes, you can use JS directly since it does support websockets.
@@CodeCraftersCorner yes, i mean that it is possible to build a very customized node with new widgets as user interface using JS. anyway, your videos are very good!
Hello, you may want to look into custom nodes then. To answer the question, yes, you can build new widgets.
Hello Sharvin, is there anyway to check the network setting on gradio to see what information was sent via payload to the API (that generated the image)? I am trying to increment the seed in python so I can generate new images on every click generate action.
Hello Mehrad, yes, you can use your browser's developer's tool to check the network activities. This will give you the payload which Gradio is sending to the backend. This does not show you what is sent to ComfyUI. I have added a new file to the Github repo (link in video description). The file is called "example_with_random_seed.py" where you can take a look at how to manipulate the seed. You will need line 4 and 38. Make sure to change "3" to your node ID number.
Thank you, I took a look - I just used 'prompt["3"]["inputs"]["seed"] += 1'. Do you do any tutoring, I can pay you for pair programming.@@CodeCraftersCorner
...but it doesn't work if I enter the same prompt, only 1 image is generated
nevermind, I used 'with open("workflow_api.json", "w") as file_json:' after I increment the seed by 1, and it works now for some reason...
@mehradbayat9665 Glad you got it to work!
Excellent!
Thank you, @seadude!
Super excellent.
👍
Hello Sir! Your tutorials are amazing! I used comfyUI quite a lot and am very comfortable using it. This tutorial is next on my list but I also have a question. Is it possible to basically do the same thing but with a Mobile Application? I'm planning to create a simple yet fun Image worflow and would like to release it as a Mobile app. Would that be possible and if so, could you tell me what I would have to learn to get to that point?
Thank you, @beatemero6718. Yes, you can. At the end of the video, I show how to use the app on mobile. If you are making a native application, you will need to make you own ComfyUI API depending on the workflow used.
@@CodeCraftersCorner oh wow! Thank you for responding. I will watch the video to the end as soon as i have Time. Looking forward to it. 😁
👍
thanks, it very helpful but its gradio only work for 72h so how we make them available for 24*7 on the web, basically I want to make the web application so it should be accessed by anyone and any time on the web
Thanks for watching. Yes, when using gradio's public URL, there is a time limit restriction. You can look into setting up your own Share Server on your own cloud server to overcome this restriction. here is a great resource for sharing gradio app: bit.ly/3TQqjK7
@@CodeCraftersCorner hello sir I have tried some thing but I got way to much confused I request to provide the guides to on this please sir
how to replicate what we have on comfyUI in python? instead of calling API
Hi @fintech1378! If you do not want to use the API, then you will have to implement the image generation with stable diffusion pipeline from HuggingFace. Of course, you will require handling tokenizing the text, loading and converting images to tensors and passing them over to the pipeline. Note that, you will not get the benefit of optimal loading of models that ComfyUI provide out to the box. That will have to be implemented manually. It is possible but too time consuming. If you are planning on doing everything from scratch, check out the documentation on HuggingFace website.
Thank you for this tutorial, it's super clear! Your approach is very interesting, you are sending the entire workflow json each time in a new payload. I never thought of doing it that way. I will be using radio buttons to basically assemble many parts of a complete prompt - so I will be changing the positive prompt in the json each time. I have a question however - I do plan to run this on cloud GPU's, I suppose I will need to select a service provider which let's me manage the storage/file system if I am to wrangle the output images. ps: I sent you an email offering some freelance work if you're open to it. Thanks again.
Hello @alpaykasal2902! Thank you, I replied to your email.
Yes, you will need the storage/file system.
If I use "share=True" it doesn't work in both local and public URL's
Hello @mrleotheo! when you use share=True, you will get two URLs in the terminal. One is localhost and the other is a public URL provided by Gradio. If you want to use your public ip address, you will need to do additional setup. You can check the Gradio official documentation for that.
@@CodeCraftersCorner thank you for fast answer. I will check it more more carefully
@mrleotheo Here is the link with some solutions: bit.ly/3TQqjK7
@@CodeCraftersCorner thank you, I just try to sharing demo like in your video, but it doesn't work. Only white screen. If I add prevent_thread_lock=True - it shows "Killing tunnel"
@mrleotheo It might be some network firewall on your computer. Not sure exactly. Sorry!
thx a lot
Glad it helped, @Herbstleid!
hmmm. Infinite while loops - nice
Thanks. You can also use Websockets which allows getting the intermediate preview images but you will have to use the same while loop.
Hello Sharvin, I don't know if my comment keeps getting deleted or I can't see it, anyway, I was wondering if you offer pair programming/tutor services. I am looking for 4 hours/twice a week, it would amount to $120/week, but I can negotiate if you are interested. You are an excellent teacher, would love to discuss further.
Hello Mehrad, Thank you so much for your kind words. I'm open to discussing the details further. Could you please send me an email at CodeCraftersCorner@gmail.com, so we can discuss the details; schedule, pricing, and any other specific requirements you may have.