GithubHelp home page GithubHelp logo

Image inpainting about diffusers HOT 7 OPEN

krrishdholakia avatar krrishdholakia commented on May 18, 2024
Image inpainting

from diffusers.

Comments (7)

krrishdholakia avatar krrishdholakia commented on May 18, 2024

Did some further research:

  • so if i have the cloth mask, cloth image, human image, human image parsed, human pose --> what is a way i can concatenate these together to present the input image to the diffuser model, and have it generate an output and then match that against the expected output?

  • ideally, i could just concatenate the cloth image + human image and check output against the expected one.

open to thoughts/ ways of doing this .

from diffusers.

krrishdholakia avatar krrishdholakia commented on May 18, 2024

hi @anton-l,

just wanted to circle back to this. I'm not sure how i could concat the 2 images and pass that + output through the diffusion model. Curious if you might have any ideas for how to approach this?

cc: @patrickvonplaten, @patil-suraj

from diffusers.

anton-l avatar anton-l commented on May 18, 2024

Hi @krrishdholakia! By setting in_channels and out_channels in the UNet configuration you can adapt it to concatenated input and outputs, e.g. in_channels=6 for two concatenated input images.

from diffusers.

krrishdholakia avatar krrishdholakia commented on May 18, 2024

@anton-l How would you calculate loss at the interim stages for this? since you want it to generate a target image different (i.e. person wearing the clothing) from the concatenated images (clothing item + source person image)

# Predict the noise residual noise_pred = model(noisy_images, timesteps)["sample"] loss = F.mse_loss(noise_pred, noise) accelerator.backward(loss)

from diffusers.

krrishdholakia avatar krrishdholakia commented on May 18, 2024

hey @anton-l just wanted to follow up on this

cc: @patil-suraj @patrickvonplaten

from diffusers.

anton-l avatar anton-l commented on May 18, 2024

@krrishdholakia the idea would be to feed the concatenated clothing + person images (6 channels), and have 6 channels as output as well (since the number of channels needs to match to compute the residuals). Then the first (or last) 3 channels of the output would be your predicted clothed person, and the other 3 channels can be discarded (not used for the loss calculation). This is similar to how super-resolution is done with diffusion models.

from diffusers.

patil-suraj avatar patil-suraj commented on May 18, 2024

Hey @krrishdholakia not quite what you're looking for, but we now have an in-painting example with stable diffusion here https://github.com/huggingface/diffusers/tree/main/examples/inference#in-painting-using-stable-diffusion

from diffusers.

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.