A custom ModularPipelineBlocks that uses Google's Gemini API to expand short prompts into detailed, vivid image generation prompts.
Requirement
Install the Google Generative AI package:
pip install google-generativeai
Setup
Get your Gemini API key from
Google AI Studio
and set it as an environment variable:
export GOOGLE_API_KEY="your-api-key-here"
Usage
from diffusers.modular_pipelines import ModularPipelineBlocks
gemini_block = ModularPipelineBlocks.from_pretrained(
"diffusers-internal-dev/gemini-prompt-expander",
trust_remote_code=True,
)
gemini = gemini_block.init_pipeline()
output = gemini(prompt="a dog sitting by the river, watching the sunset")
print(f"{output.values['prompt']=}")
Use in Mellon
This block includes a
mellon_pipeline_config.json
for use with
Mellon
:
Drag a
Dynamic Block Node
from the ModularDiffusers section
Enter
diffusers-internal-dev/gemini-prompt-expander
as the repo_id
The node will transform to show the prompt input and expanded prompt output
Runs of diffusers gemini-prompt-expander-mellon on huggingface.co
0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About gemini-prompt-expander-mellon huggingface.co Model
gemini-prompt-expander-mellon huggingface.co
gemini-prompt-expander-mellon huggingface.co is an AI model on huggingface.co that provides gemini-prompt-expander-mellon's model effect (), which can be used instantly with this diffusers gemini-prompt-expander-mellon model. huggingface.co supports a free trial of the gemini-prompt-expander-mellon model, and also provides paid use of the gemini-prompt-expander-mellon. Support call gemini-prompt-expander-mellon model through api, including Node.js, Python, http.
gemini-prompt-expander-mellon huggingface.co is an online trial and call api platform, which integrates gemini-prompt-expander-mellon's modeling effects, including api services, and provides a free online trial of gemini-prompt-expander-mellon, you can try gemini-prompt-expander-mellon online for free by clicking the link below.
diffusers gemini-prompt-expander-mellon online free url in huggingface.co:
gemini-prompt-expander-mellon is an open source model from GitHub that offers a free installation service, and any user can find gemini-prompt-expander-mellon on GitHub to install. At the same time, huggingface.co provides the effect of gemini-prompt-expander-mellon install, users can directly use gemini-prompt-expander-mellon installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
gemini-prompt-expander-mellon install url in huggingface.co: