Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you tell us the same commands you used in the replicate.com model? #8

Open
wes-kay opened this issue Jun 20, 2022 · 5 comments
Open

Comments

@wes-kay
Copy link

wes-kay commented Jun 20, 2022

Trying to get similar results but can't tune them enough to get them.

python sample.py --init_image imgName --skip_timesteps 10 --model_path finetune.pt --batch_size 8 --num_batches 8 --text text

@afiaka87
Copy link
Collaborator

@wes-kay The Replicate models use either erlich.pt or ongo.pt

@afiaka87
Copy link
Collaborator

@wes-kay I can also add instructions for how to build your own cog image (backend for replicate) so you can have the exact same setup. Would that be useful?

@wes-kay
Copy link
Author

wes-kay commented Jun 22, 2022

@afiaka87 That would be amazing, I was trying to copy the step size of 100 as one of the arguments but I'm seeing that there's no similarities between what's set in the sample.py and the site fields, once I removed that I'm getting pretty similar results as to the site.

I think being able to see what has been set on would be great, as there's not a lot of info I've gotten from reading the code that transfers to the site fields.

parser.add_argument('--model_path', type=str, default='finetune.pt',
                    help='path to the diffusion model')

parser.add_argument('--kl_path', type=str, default='kl-f8.pt',
                    help='path to the LDM first stage model')

parser.add_argument('--bert_path', type=str, default='bert.pt',
                    help='path to the LDM first stage model')

parser.add_argument('--text', type=str, required=False, default='',
                    help='your text prompt')

parser.add_argument('--edit', type=str, required=False,
                    help='path to the image you want to edit (either an image file or .npy containing a numpy array of the image embeddings)')

parser.add_argument('--edit_x', type=int, required=False, default=0,
                    help='x position of the edit image in the generation frame (need to be multiple of 8)')

parser.add_argument('--edit_y', type=int, required=False, default=0,
                    help='y position of the edit image in the generation frame (need to be multiple of 8)')

parser.add_argument('--edit_width', type=int, required=False, default=0,
                    help='width of the edit image in the generation frame (need to be multiple of 8)')

parser.add_argument('--edit_height', type=int, required=False, default=0,
                    help='height of the edit image in the generation frame (need to be multiple of 8)')

parser.add_argument('--mask', type=str, required=False,
                    help='path to a mask image. white pixels = keep, black pixels = discard. width = image width/8, height = image height/8')

parser.add_argument('--negative', type=str, required=False, default='',
                    help='negative text prompt')

parser.add_argument('--init_image', type=str, required=False, default=None,
                    help='init image to use')

parser.add_argument('--skip_timesteps', type=int, required=False, default=0,
                    help='how many diffusion steps are gonna be skipped')

parser.add_argument('--prefix', type=str, required=False, default='',
                    help='prefix for output files')

parser.add_argument('--num_batches', type=int, default=1, required=False,
                    help='number of batches')

parser.add_argument('--batch_size', type=int, default=1, required=False,
                    help='batch size')

parser.add_argument('--width', type=int, default=256, required=False,
                    help='image size of output (multiple of 8)')

parser.add_argument('--height', type=int, default=256, required=False,
                    help='image size of output (multiple of 8)')

parser.add_argument('--seed', type=int, default=-1, required=False,
                    help='random seed')

parser.add_argument('--guidance_scale', type=float, default=5.0, required=False,
                    help='classifier-free guidance scale')

parser.add_argument('--steps', type=int, default=0, required=False,
                    help='number of diffusion steps')

parser.add_argument('--cpu', dest='cpu', action='store_true')

parser.add_argument('--clip_score', dest='clip_score', action='store_true')

parser.add_argument('--clip_guidance',
                    dest='clip_guidance', action='store_true')

parser.add_argument('--clip_guidance_scale', type=float, default=150, required=False,
                    help='Controls how much the image should look like the prompt')  # may need to use lower value for ddim

parser.add_argument('--cutn', type=int, default=16, required=False,
                    help='Number of cuts')

#turn on to use 50 step ddim
parser.add_argument('--ddim', dest='ddim', action='store_true')

#turn on to use 50 step ddim
parser.add_argument('--ddpm', dest='ddpm', action='store_true')

@neurofuzzy
Copy link

I would love to have this as well. The replicate setup is perfect for my tastes. I tried putting together a Google Colab but I've never done it before and am a bit lost. There's a colab that uses ongo called "Latent Majesty Diffusion" which gets pretty close but I haven't gotten anything near as good as what comes out of replicate.

@afiaka87
Copy link
Collaborator

afiaka87 commented Aug 5, 2022

@wes-kay @neurofuzzy I've added instructions for this btw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants