Git Product home page Git Product logo

Comments (6)

ikuinen avatar ikuinen commented on July 18, 2024

Definitely yes. That is a good point. A simple way is to give a lower mask alignment strength, which let the models generate the region outside of the mask more freely. Another way is to give pixel-wise control scales instead of a single scalar.

from editanything.

DJBen avatar DJBen commented on July 18, 2024

@ikuinen thank you for your quick reply! I tried lower mask alignment strength, and it is not very optimal - it sometimes will grow extra legs, while not diversifying the background much.

Another way is to give pixel-wise control scales instead of a single scalar.

Can you elaborate on this approach? Which parameter should I supply? 🙏

from editanything.

ikuinen avatar ikuinen commented on July 18, 2024

Thanks for your interest. The mask alignment strength is a control scalar, while I think you could use a heatmap-like control scale. The value in region of dog could be one. The area around the dog could be lower and the rest could be zero. Just a simple idea and haven't tried yet. This may be a further feature that can be added into EditAnything.

from editanything.

DJBen avatar DJBen commented on July 18, 2024

@ikuinen Thank you for your insight - I would like to experiment your approach, but I didn't locate a way to provide a heatmap as you described.

In StableDiffusionControlNetInpaintPipeline, __call__: I think control_net_conditioning_scale is a float or List[float], and the alignment_ratio looks like a Optional[float].

Could you give a code pointer of how this is achieved? Much thanks!

from editanything.

ikuinen avatar ikuinen commented on July 18, 2024

Hi~@DJBen, you could checkout the dev branch. I have implemented a version to control the scale in pixel-wise style, named controlnet_conditioning_scale_map. By simply setting a higher scale around the dog while zero scale for the rest, the problem could be solved in a way.

Prompt: "a dog in beach, photorealistic, best quality, extremely detailed"

Original image Mask Inpainted image Control scale map
Doggo mask_image dog_res1 control_map

from editanything.

DJBen avatar DJBen commented on July 18, 2024

That is amazing. You are awesome. I'll try it at my earliest convenience.

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.