timothybrooks / instruct-pix2pix

Other
6.35k stars 535 forks source link

How to set the parameters? #71

Open natureXD opened 1 year ago

natureXD commented 1 year ago

I want to try the function, but it has not been very satisfying like the pictures in papar, Can you tell me how should I to adjust the parameters? My result: 1675918833608

I want: 6

andreemic commented 1 year ago

Citing the edit_app.py Gradio page:

If you're not getting what you want, there may be a few reasons:

  1. Is the image not changing enough? Your Image CFG weight may be too high. This value dictates how similar the output should be to the input. It's possible your edit requires larger changes from the original image, and your Image CFG weight isn't allowing that. Alternatively, your Text CFG weight may be too low. This value dictates how much to listen to the text instruction. The default Image CFG of 1.5 and Text CFG of 7.5 are a good starting point, but aren't necessarily optimal for each edit. Try:
    • Decreasing the Image CFG weight, or
    • Incerasing the Text CFG weight, or
  2. Conversely, is the image changing too much, such that the details in the original image aren't preserved? Try:
    • Increasing the Image CFG weight, or
    • Decreasing the Text CFG weight
  3. Try generating results with different random seeds by setting "Randomize Seed" and running generation multiple times. You can also try setting "Randomize CFG" to sample new Text CFG and Image CFG values each time.
  4. Rephrasing the instruction sometimes improves results (e.g., "turn him into a dog" vs. "make him a dog" vs. "as a dog").
  5. Increasing the number of steps sometimes improves results.
  6. Do faces look weird? The Stable Diffusion autoencoder has a hard time with faces that are small in the image. Try:
    • Cropping the image so the face takes up a larger portion of the frame.