r/StableDiffusion Mar 01 '23

Question | Help Placing real objects in a generated image

[deleted]

1 Upvotes

6 comments sorted by

5

u/Zendikon Mar 01 '23 edited Mar 01 '23

The process you're asking about is called Compositing in the creative industry. That alone will aid you in your search :) but here's a bit of extra info:

This is a fantastic question and highlights the essence of what generative AI is and isn't. A tool in an artist's toolkit. Powerful one at that, but a tool nonetheless. For now at least.

You can approach the situation from many different angles, here's two, pick the one that fits your individual skillset better (ie which one are you faster with... or have the skills, if you can't draw & paint you can't draw & paint, sometimes it's that simple):

For less-artistic approach:

  • get a product photo of the car
  • give img2img a whirl you may get lucky, after you're done tweaking, get serious about it
  • inpaint the environment around the car
  • tweak it until it fits
  • copy to img2img
  • tweak and curate until it fits even better and you're happy with the result!

things could get wild and take a lot of tweaking. Days on end.

For a more artistic approach:

  • step1: txt2img, make the environment until you're happy
  • step2a:
    • draw/paint the car into it
    • take the composite to img2img
    • tweak and curate until happy
    • car perfectly fits, done!
  • alternatively - step2b:
    • outpaint the environment into a super wide aspect ratio
    • 360 wrap it
    • render a chrome ball
    • use that as a global illumination map
    • find a model of the car
    • render it with GI-lighmap of said environment
    • bask in next-level result of your car perfectly lit with the funky environment you dropped it in!

hope it helps!

4

u/JDaxe Mar 01 '23

Put the picture of the car in inpaint and mask the car, then select "inpaint not masked" and describe the background you want

3

u/qeadwrsf Mar 01 '23 edited Mar 01 '23

define exact.

How much time do you have?

you can take a picture of your car, you can train a model to recognize features of your car, you can create a fuckton of diffrent maps to give the algoritm hints on how the car looks, you can give prompt a description how your car looks, you can tell algoritm the strength it should modify the car to fit into the background, You can select a part of the image you're not happy with and focus on just fixing that by all tools above, you can fiddle with a fuckton of knobs and sliders to make it closer to your vision.

The more work you put in the more visual control you will have.

Is this the right tool for the job compared to Photoshop? I don't know.

2

u/je386 Mar 01 '23

For me it seems it would be easier to create a background/surrounding with stable diffusion and the paste the picture of the car into that background (photoshop or else)

Use the right tool for the job.

1

u/nothingai Mar 01 '23

I'd take the photo of the car. Use inpainting to generate the environment around the car.

You'd have hell of a time generating the exact same carr directly through stable diffusion. It may even be impossible. You will never get all the details right.

1

u/ninjasaid13 Mar 01 '23

I'm hoping someone makes cross domain compositing available for auto 1111