Skip to content

no option to include negative prompts in python CLI help? #160

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

Closed
sarahspak opened this issue Apr 21, 2023 · 4 comments
Closed

no option to include negative prompts in python CLI help? #160

sarahspak opened this issue Apr 21, 2023 · 4 comments

Comments

@sarahspak
Copy link

sarahspak commented Apr 21, 2023

Ran python -m python_coreml_stable_diffusion.pipeline --help but am not seeing an option for negative_prompts, though based on this issue, it seems it should be available unless I'm misunderstanding something?

usage: pipeline.py [-h] --prompt PROMPT -i I -o O [--seed SEED] [--model-version MODEL_VERSION] [--compute-unit {ALL,CPU_AND_GPU,CPU_ONLY,CPU_AND_NE}]
                   [--scheduler {DDIM,DPMSolverMultistep,EulerAncestralDiscrete,EulerDiscrete,LMSDiscrete,PNDM}] [--num-inference-steps NUM_INFERENCE_STEPS] [--guidance-scale GUIDANCE_SCALE]
                   [--controlnet [CONTROLNET ...]] [--controlnet-inputs [CONTROLNET_INPUTS ...]]

options:
  -h, --help            show this help message and exit
  --prompt PROMPT       The text prompt to be used for text-to-image generation.
  -i I                  Path to input directory with the .mlpackage files generated by python_coreml_stable_diffusion.torch2coreml
  -o O
  --seed SEED, -s SEED  Random seed to be able to reproduce results
  --model-version MODEL_VERSION
                        The pre-trained model checkpoint and configuration to restore. For available versions: https://huggingface.co/models?search=stable-diffusion
  --compute-unit {ALL,CPU_AND_GPU,CPU_ONLY,CPU_AND_NE}
                        The compute units to be used when executing Core ML models. Options: ('ALL', 'CPU_AND_GPU', 'CPU_ONLY', 'CPU_AND_NE')
  --scheduler {DDIM,DPMSolverMultistep,EulerAncestralDiscrete,EulerDiscrete,LMSDiscrete,PNDM}
                        The scheduler to use for running the reverse diffusion process. If not specified, the default scheduler from the diffusers pipeline is utilized
  --num-inference-steps NUM_INFERENCE_STEPS
                        The number of iterations the unet model will be executed throughout the reverse diffusion process
  --guidance-scale GUIDANCE_SCALE
                        Controls the influence of the text prompt on sampling process (0=random images)
  --controlnet [CONTROLNET ...]
                        Enables ControlNet and use control-unet instead of unet for additional inputs. For Multi-Controlnet, provide the model names separated by spaces.
  --controlnet-inputs [CONTROLNET_INPUTS ...]
                        Image paths for ControlNet inputs. Please enter images corresponding to each controlnet provided at --controlnet option in same order.

Version: pip freeze | grep "diffusion"
Returns

python-coreml-stable-diffusion @ git+https://github.com/apple/ml-stable-diffusion@5d2744e38297b01662b8bdfb41e899ac98036d8b
@atiorh
Copy link
Contributor

atiorh commented Apr 21, 2023

Hello @sarahspak, the issue you referenced points to a PR that added negative prompts to the Swift CLI only. If you would like to add negative prompts to the Python CLI as well, feel free to put up a PR for that. Thanks for bringing this up!

@sarahspak
Copy link
Author

got it - happy to do so!
I did notice an argument for [negative_prompt](https://github.com/apple/ml-stable-diffusion/blob/ce0be82717016f9a0bbdc6a09202860808203e7e/python_coreml_stable_diffusion/pipeline.py#L112) in the pipeline.py file. Was this feature not fully implemented?

@atiorh atiorh closed this as completed in 412c679 Apr 24, 2023
@atiorh
Copy link
Contributor

atiorh commented Apr 24, 2023

Just pushed the change to unblock you, please open another issue if you hit any problems 🙏

@sarahspak
Copy link
Author

thank you @atiorh!

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

2 participants