Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
Text-to-image generator using g4f and Python with model selection and clipboard support
Jump to setup instructionsFetched from the repository for this visit.
A convenient console tool for generating images based on a text description (promt) in Python using the g4f library. It supports several models: Bing, DeepAI, Flux and Pollinations.
Choosing a generation model
The main cycle
User input of promt
Commands:
exit, выход, quit — terminate the script/model — change the model without restartingResult generation and output
API request:
response = client.images.generate(
model=model,
prompt=prompt,
response_format="url"
)
image_url = response.data[0].url
Auto-copying of the link to the clipboard (pyperclip.copy)
Beep on successful generation (winsound.MessageBeep)
Error handling
Interception of exceptions and message output:
Generation error: <error text>
winsound operation)g4fpyperclipwinsound (included in the Windows standard library)Clone the repository:
git clone https://github.com/KiriVoll/AI-Picture-Generator.git
cd AI-Picture-Generator
Install the dependencies:
pip install g4f pyperclip
Run the script with the command:
python AIpictureGenerator.py
At the first launch, select the generation model (1-4).
Enter the promt in the console and press Enter.
After generation:
To change the model, enter the command /model.
Use quit, exit or выход to exit.
The script intercepts all exceptions that occur when accessing the API and outputs them in a clear format. This allows you to continue working after an unsuccessful request.
base64 or byte datatkinter or PyQt librariesIf you find this useful, feel free to star ⭐ the repo or share your improvements!
GitHub checked 208h ago - refresh overdue. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.