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

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

Open
hzhou17 opened this issue Jun 27, 2023 · 14 comments
Open

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

hzhou17 opened this issue Jun 27, 2023 · 14 comments

Comments

@hzhou17
Copy link

hzhou17 commented Jun 27, 2023

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.

@gasvn
Copy link
Collaborator

gasvn commented Jun 27, 2023

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.

@Guanyuansheng
Copy link

Guanyuansheng commented Jun 29, 2023

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!

@ennnnny
Copy link

ennnnny commented Jun 29, 2023

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!😀

@gasvn
Copy link
Collaborator

gasvn commented Jun 30, 2023

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
Copy link
Collaborator

gasvn commented Jun 30, 2023

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

x_samples = self.pipe(
to use the cross-image drag in the google colab. This would aovid the OOM problem I suppose.

@gamingflexer
Copy link

gamingflexer commented Jun 30, 2023

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

x_samples = self.pipe(

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 !

@ennnnny
Copy link

ennnnny commented Jun 30, 2023

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

x_samples = self.pipe(

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
Copy link

ennnnny commented Jun 30, 2023

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

x_samples = self.pipe(

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.

@gamingflexer
Copy link

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

x_samples = self.pipe(

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 !

@gasvn
Copy link
Collaborator

gasvn commented Jul 1, 2023

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

x_samples = self.pipe(

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.

@gamingflexer
Copy link

gamingflexer commented Jul 5, 2023

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

x_samples = self.pipe(

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 : )

@ZhouYaoxue
Copy link

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

@schananas
Copy link

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

@zhengyi0533
Copy link

How to use it with controlnet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants