EditAnything icon indicating copy to clipboard operation
EditAnything copied to clipboard

How to use "Cross-Image region drag and merge"?

Open hzhou17 opened this issue 2 years ago • 14 comments

I am sorry if this is not the place to ask questions.

I launched the gradio through editany.py. But I did not figure out how to select a green region and drag merge another image, as shown in the Features area. I think it is really cool to drag and merge the outfit of the superman.

Would really appreciate it if the author or anybody else could help me out.

hzhou17 avatar Jun 27 '23 00:06 hzhou17

To reproduce our results, you can launch the editany_test.py And there is a reference tab in the grdio demo. You can update the image in reference tab then select the region you want to drag. We will update the readme file, thanks.

gasvn avatar Jun 27 '23 01:06 gasvn

To reproduce our results, you can launch the editany_test.py And there is a reference tab in the grdio demo. You can update the image in reference tab then select the region you want to drag. We will update the readme file, thanks.

The environment required by editany_test.py is not consistent with environment.yaml (for example, running editany_test.py with the environment installed by environment.yaml will report multiple errors such as such as missing xformers and diffusers versions), please update the readme file as soon as possible. Thanks for your contribution!

Guanyuansheng avatar Jun 29 '23 03:06 Guanyuansheng

Curious about the effect of "Cross-Image region drag and merge". I tried to run it in google colab and found that the memory exceeded 12G causing the startup to fail, and there may be a problem with environment.yaml. It would be great if could provide a google colab configuration!😀

ennnnny avatar Jun 29 '23 09:06 ennnnny

To reproduce our results, you can launch the editany_test.py And there is a reference tab in the grdio demo. You can update the image in reference tab then select the region you want to drag. We will update the readme file, thanks.

The environment required by editany_test.py is not consistent with environment.yaml (for example, running editany_test.py with the environment installed by environment.yaml will report multiple errors such as such as missing xformers and diffusers versions), please update the readme file as soon as possible. Thanks for your contribution!

Thanks for the feedback, I have updated the packages in environment.yaml. Please let me know if you still encounter errors.

gasvn avatar Jun 30 '23 02:06 gasvn

Curious about the effect of "Cross-Image region drag and merge". I tried to run it in google colab and found that the memory exceeded 12G causing the startup to fail, and there may be a problem with environment.yaml. It would be great if could provide a google colab configuration!😀

Other extra modules like BLIP model and SAM model may cost some GPU memory. You can extract ths function https://github.com/sail-sg/EditAnything/blob/572298811b13d90569fb39bbf48e624168e9a005/editany_lora.py#L825 to use the cross-image drag in the google colab. This would aovid the OOM problem I suppose.

gasvn avatar Jun 30 '23 02:06 gasvn

Curious about the effect of "Cross-Image region drag and merge". I tried to run it in google colab and found that the memory exceeded 12G causing the startup to fail, and there may be a problem with environment.yaml. It would be great if could provide a google colab configuration!😀

Other extra modules like BLIP model and SAM model may cost some GPU memory. You can extract ths function

https://github.com/sail-sg/EditAnything/blob/572298811b13d90569fb39bbf48e624168e9a005/editany_lora.py#L825

to use the cross-image drag in the google colab. This would aovid the OOM problem I suppose. Screenshot 2023-06-30 at 10 08 11 AM

I am also getting issues. I have attached the collab here. Really appreciate your help !

gamingflexer avatar Jun 30 '23 04:06 gamingflexer

Curious about the effect of "Cross-Image region drag and merge". I tried to run it in google colab and found that the memory exceeded 12G causing the startup to fail, and there may be a problem with environment.yaml. It would be great if could provide a google colab configuration!😀

Other extra modules like BLIP model and SAM model may cost some GPU memory. You can extract ths function

https://github.com/sail-sg/EditAnything/blob/572298811b13d90569fb39bbf48e624168e9a005/editany_lora.py#L825

to use the cross-image drag in the google colab. This would aovid the OOM problem I suppose.

environment.yaml need safetensors>=0.3.1

Thanks for the update! I tested it on a 3080Ti graphics card with 32G RAM machine and was able to run it, but the generated graphs were very resource intensive. Tried several times and failed to achieve similar results as the demo. Hopefully a more detailed tutorial on how to do this will follow.

ennnnny avatar Jun 30 '23 10:06 ennnnny

Curious about the effect of "Cross-Image region drag and merge". I tried to run it in google colab and found that the memory exceeded 12G causing the startup to fail, and there may be a problem with environment.yaml. It would be great if could provide a google colab configuration!😀

Other extra modules like BLIP model and SAM model may cost some GPU memory. You can extract ths function https://github.com/sail-sg/EditAnything/blob/572298811b13d90569fb39bbf48e624168e9a005/editany_lora.py#L825

to use the cross-image drag in the google colab. This would aovid the OOM problem I suppose.

Screenshot 2023-06-30 at 10 08 11 AM I am also getting issues. I have attached the [collab](https://colab.research.google.com/drive/1eLnlD8ACvzawbBX7vUPlHU6a9f_Tn0Vz?usp=sharing) here. Really appreciate your help !

You can try my https://github.com/ennnnny/sd_colab/blob/self/editanything.ipynb but I haven't solved the OOM problem. Maybe the colab Pro account can perform.

ennnnny avatar Jun 30 '23 10:06 ennnnny

Curious about the effect of "Cross-Image region drag and merge". I tried to run it in google colab and found that the memory exceeded 12G causing the startup to fail, and there may be a problem with environment.yaml. It would be great if could provide a google colab configuration!😀

Other extra modules like BLIP model and SAM model may cost some GPU memory. You can extract ths function https://github.com/sail-sg/EditAnything/blob/572298811b13d90569fb39bbf48e624168e9a005/editany_lora.py#L825

to use the cross-image drag in the google colab. This would aovid the OOM problem I suppose.

Screenshot 2023-06-30 at 10 08 11 AM I am also getting issues. I have attached the [collab](https://colab.research.google.com/drive/1eLnlD8ACvzawbBX7vUPlHU6a9f_Tn0Vz?usp=sharing) here. Really appreciate your help !

You can try my https://github.com/ennnnny/sd_colab/blob/self/editanything.ipynb but I haven't solved the OOM problem. Maybe the colab Pro account can perform.

Thanks will look into it !

gamingflexer avatar Jun 30 '23 10:06 gamingflexer

https://github.com/ennnnny/sd_colab/blob/self/editanything.ipynb

Curious about the effect of "Cross-Image region drag and merge". I tried to run it in google colab and found that the memory exceeded 12G causing the startup to fail, and there may be a problem with environment.yaml. It would be great if could provide a google colab configuration!😀

Other extra modules like BLIP model and SAM model may cost some GPU memory. You can extract ths function https://github.com/sail-sg/EditAnything/blob/572298811b13d90569fb39bbf48e624168e9a005/editany_lora.py#L825

to use the cross-image drag in the google colab. This would aovid the OOM problem I suppose.

environment.yaml need safetensors>=0.3.1

Thanks for the update! I tested it on a 3080Ti graphics card with 32G RAM machine and was able to run it, but the generated graphs were very resource intensive. Tried several times and failed to achieve similar results as the demo. Hopefully a more detailed tutorial on how to do this will follow.

As this solution is training-free, you need to adjust the parameters to get the good results. Also, I find that the text prompt is important. If you cannot get a good description of your reference region, you can train the reference region with text inversion to get a good text embedding. I will upload a tutorial, thanks for your advice.

gasvn avatar Jul 01 '23 08:07 gasvn

https://github.com/ennnnny/sd_colab/blob/self/editanything.ipynb

Curious about the effect of "Cross-Image region drag and merge". I tried to run it in google colab and found that the memory exceeded 12G causing the startup to fail, and there may be a problem with environment.yaml. It would be great if could provide a google colab configuration!😀

Other extra modules like BLIP model and SAM model may cost some GPU memory. You can extract ths function https://github.com/sail-sg/EditAnything/blob/572298811b13d90569fb39bbf48e624168e9a005/editany_lora.py#L825

to use the cross-image drag in the google colab. This would aovid the OOM problem I suppose.

environment.yaml need safetensors>=0.3.1 Thanks for the update! I tested it on a 3080Ti graphics card with 32G RAM machine and was able to run it, but the generated graphs were very resource intensive. Tried several times and failed to achieve similar results as the demo. Hopefully a more detailed tutorial on how to do this will follow.

As this solution is training-free, you need to adjust the parameters to get the good results. Also, I find that the text prompt is important. If you cannot get a good description of your reference region, you can train the reference region with text inversion to get a good text embedding. I will upload a tutorial, thanks for your advice.

Results were not that great but hopefully your tutorial can help us !

Tutorial for this would be great. Thanks waiting for it : )

gamingflexer avatar Jul 05 '23 09:07 gamingflexer

the "Cross-image region drag and merge" is great, but which files can i read to know how it works

ZhouYaoxue avatar Jul 24 '23 09:07 ZhouYaoxue

did someone managed to make tutorial for cross image region drag and merge? really curious to try out this functionality

schananas avatar Sep 11 '23 10:09 schananas

How to use it with controlnet?

zhengyi0533 avatar Sep 17 '23 03:09 zhengyi0533