Git Product home page Git Product logo

Comments (8)

SkyCol avatar SkyCol commented on July 18, 2024

Hello, I want to edit image and don't change the mask rigion. If without any UI, which python file should I read.
I just change sam2Image.py by inputing a single point to segment-anything model, but the rigion still changed(as I want to use like inpaint). Can you teach me about this , thank you!

from editanything.

gasvn avatar gasvn commented on July 18, 2024

Hi, the sam2edit is renamed to editany. The class EditAnythingLoraModel can be used without UI. If you want to keep the unmasked region, you need to set the ‘mask_image’

from editanything.

SkyCol avatar SkyCol commented on July 18, 2024

Thank you! It shows inpaint can only used with SD1.5 , can I use sd2.1 to do this?

from editanything.

gasvn avatar gasvn commented on July 18, 2024

You can use sd2.1 by the following way. Due to the SD2.1 uses different inpainting method, it cannot support lora model for now.
model = EditAnythingLoraModel(
base_model_path="stabilityai/stable-diffusion-2",
controlmodel_name="LAION Pretrained(v0-4)-SD21",
extra_inpaint=False,
lora_model_path=None,
use_blip=True)

from editanything.

SkyCol avatar SkyCol commented on July 18, 2024

ok,but when using sd1.5 and LAION Pretrained SD1.5,I get an error: RuntimeError: mat1 and mat2 shapes cannot be multiplied (66x768 and 1024x320)_
and when I use sd2.1 and LAION Pretrained SD2.1(extra_inpaint = false) , I get a result like this(want to redraw the car)
image
By the way ,What's the parameter extra_inpaint means. thankyou for your reply.

from editanything.

SkyCol avatar SkyCol commented on July 18, 2024

My target is to replace the car according to my prompt(without blip), here is the result on your website ,it‘s great , What should I do to achieve this?I call model.procee but I failed.
image

from editanything.

SkyCol avatar SkyCol commented on July 18, 2024

Sorry,I tried successfully on SD1.5,The error I mentioned RuntimeError: mat1 and mat2 shapes cannot be multiplied (66x768 and 1024x320)_ is because I choose a wrong path of controlNet , 768 is embedding size of SD1.5 while 1024 is SD2.1. It's my mistake..

from editanything.

affromero avatar affromero commented on July 18, 2024

@SkyCol how/where exactly did you fix the RuntimeError?

from editanything.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.