Downloads · 30 days
0
nevreal/t2i-custom
t2i-custom is a machine learning model from nevreal. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Argument Parsing: We use the argparse library to accept parameters through the command line like prompt, model, steps, width, and other parameters that were inputs in the Gradio interface. Image Generation Logic: The…
Downloads · 30 days
0
Access
Public
Updated Sep 25, 2024
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py24.9 KB · 91%
From the Hugging Face model README
Argument Parsing: We use the argparse library to accept parameters through the command line like prompt, model, steps, width, and other parameters that were inputs in the Gradio interface. Image Generation Logic: The function generate_images is the core image generation process, using the provided model, prompt, and settings. Random Seed: If the seed is -1, it is randomized. Prefix/Suffix: Supports positive/negative prefixes and suffixes from command-line arguments.
Save the above code in a file named image_generation.py. In your terminal, run:
python app.py --model "model_name" --prompt "1girl, solo" --steps 50 --cfg 7.5 --seed -1 --image_num 2
This will generate images based on the given arguments.