Imaginepy
ImaginePy, opensource (reversed) API like Stable Diffusion, Midjourney. Everything at 0 Cost.
Install / Use
/learn @ItsCEED/ImaginepyREADME
ImaginePy <br> <a href="https://discord.gg/axfkjqWR5E" target="_blank"> <img src="https://discordapp.com/api/guilds/1110314971012808774/widget.png?style=banner4" alt="Discord Banner 4"> </a> <br> <img src="https://img.shields.io/badge/python-3.7+-informational?style=plastic" alt="Python version"> <img src="https://img.shields.io/github/release-date/ItsCEED/ImaginePy-Midjourney-Free-Alternative?style=plastic" alt="Release"> <img src="https://img.shields.io/github/release/ItsCEED/ImaginePy-Midjourney-Free-Alternative?style=plastic" alt="Version">
</div>Features
- 🎨 Turn words into art
- 👓 Choose from an array of art styles
- 🔧 Adjust your masterpiece with creative controls!
- 📦 Stay ahead of the game with the ever-growing art library!
- 🌇 Generate wallpapers
- 🔎 Discover and explore similar artistic designs
- This is refactored and improved version of the original from hyugogirubato
Installation
Note: Requires Python 3.7.0 or newer with PIP installed.
$ python setup.py install
You now have the imaginepy package installed.
PyPi Installation
pip install imaginepy
From Source Code
The following steps are instructions on download, preparing, and running the code under a Venv environment.
You can skip steps 3-5 with a simple python setup.py install call instead, but you miss out on a wide array of benefits.
git clone https://github.com/ItsCEED/Imaginepycd Imaginepypython -m venv envsource env/bin/activatepython setup.py install
As seen in Step 5, running the imaginepy executable is somewhat different to a normal PIP installation.
See Venv's Docs on various ways of making calls under the virtual-environment.
Usage
The following is a minimal example of using ImaginePy in a script. It gets the generated image from the text and increases the quality.
from imaginepy import Imagine
from imaginepy.constants import *
def main():
imagine = Imagine()
img_data = imagine.sdprem(
prompt="Woman sitting on a table, looking at the sky, seen from behind",
style=Style.NO_STYLE,
ratio=Ratio.RATIO_16X9,
negative="",
seed=1000,
cfg=16,
model=Model.REALISTIC,
asbase64=False # default is false, putting it here as presentation.
)
if img_data is None:
print("An error occurred while generating the image.")
return
img_data = imagine.upscale(img_data)
if img_data is None:
print("An error occurred while upscaling the image.")
return
try:
with open("example.jpeg", mode="wb") as img_file:
img_file.write(img_data)
except Exception as e:
print(f"An error occurred while writing the image to file: {e}")
if __name__ == "__main__":
main()
Async version
import asyncio
from imaginepy import AsyncImagine
from imaginepy.constants import *
async def main():
imagine = AsyncImagine()
img_data = imagine.sdprem(
prompt="Woman sitting on a table, looking at the sky, seen from behind",
style=Style.NO_STYLE,
ratio=Ratio.RATIO_16X9,
negative="",
seed=1000,
cfg=16,
model=Model.REALISTIC,
asbase64=False # default is false, putting it here as presentation.
)
if img_data is None:
print("An error occurred while generating the image.")
return
img_data = await imagine.upscale(image=img_data)
if img_data is None:
print("An error occurred while upscaling the image.")
return
try:
with open("example.png", mode="wb") as img_file:
img_file.write(img_data)
except Exception as e:
print(f"An error occurred while writing the image to file: {e}")
await imagine.close()
if __name__ == "__main__":
asyncio.run(main())
Credit
- Imagine Icon © Vyro AI & API
- Original reverse and version by: hyugogirubato
License
Related Skills
gh-issues
352.2kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
352.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
352.2kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
taskflow-inbox-triage
352.2kname: taskflow-inbox-triage description: Example TaskFlow authoring pattern for inbox triage. Use when messages need different treatment based on intent, with some routes notifying immediately, some w
