docs: update readme. add docs to package

Clean up logging some more
pull/1/head
Bryce 2 years ago
parent 292d1bcab5
commit 6ac3d40009

@ -0,0 +1 @@
imaginairy-3.10.6

@ -1,5 +1,5 @@
Copyright 2022 Bryce Drennan
(for modifications on top of CompVis license)
Copyright 2022 Bryce Drennan (and numerous other contributers as documented)
(for modifications on top of CompVis code)
The MIT License

@ -31,20 +31,29 @@ Generating 🖼 : "portrait photo of a freckled woman" 512x512px seed:500686645
### Tiled Images
```bash
>> imagine "Art Nouveau mosaic" --tile
🤖🧠 received 1 prompt(s) and will repeat them 1 times to create 1 images.
Loading model onto mps backend...
Generating 🖼 : "Art Nouveau mosaic" 512x512px seed:658241102 prompt-strength:7.5 steps:40 sampler-type:PLMS
PLMS Sampler: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 40/40 [00:31<00:00, 1.28it/s]
🖼 saved to: ./outputs/000058_658241102_PLMS40_PS7.5_Art_Nouveau_mosaic.jpg
>> imagine "gold coins" "a lush forest" "piles of old books" leaves --tile
```
<img src="assets/000066_801493266_PLMS40_PS7.5_gold_coins.jpg" height="128"><img src="assets/000066_801493266_PLMS40_PS7.5_gold_coins.jpg" height="128"><img src="assets/000066_801493266_PLMS40_PS7.5_gold_coins.jpg" height="128">
<img src="assets/000118_597948545_PLMS40_PS7.5_a_lush_forest.jpg" height="128"><img src="assets/000118_597948545_PLMS40_PS7.5_a_lush_forest.jpg" height="128"><img src="assets/000118_597948545_PLMS40_PS7.5_a_lush_forest.jpg" height="128">
<br>
<img src="assets/000075_961095192_PLMS40_PS7.5_piles_of_old_books.jpg" height="128"><img src="assets/000075_961095192_PLMS40_PS7.5_piles_of_old_books.jpg" height="128"><img src="assets/000075_961095192_PLMS40_PS7.5_piles_of_old_books.jpg" height="128">
<img src="assets/000040_527733581_PLMS40_PS7.5_leaves.jpg" height="128"><img src="assets/000040_527733581_PLMS40_PS7.5_leaves.jpg" height="128"><img src="assets/000040_527733581_PLMS40_PS7.5_leaves.jpg" height="128">
### Image-to-Image
```bash
>> imagine "portrait of a smiling lady. oil painting" --init-image girl_with_a_pearl_earring.jpg
```
<img src="tests/data/girl_with_a_pearl_earring.jpg" height="256"> =>
<img src="assets/000105_33084057_DDIM40_PS7.5_portrait_of_a_smiling_lady._oil_painting._.jpg" height="256">
<img src="assets/000057_802839261_PLMS40_PS7.5_Art_Nouveau_mosaic._ornate,_highly_detailed,_sharp_focus.jpg" width="256" height="256"><img src="assets/000057_802839261_PLMS40_PS7.5_Art_Nouveau_mosaic._ornate,_highly_detailed,_sharp_focus.jpg" width="256" height="256">
## Features
- It makes images from text descriptions! 🎉
- Generate images either in code or from command line.
- It just works. Proper requirements installed, model weights automatically downloaded. No huggingface account needed. (if you have the right hardware... and aren't on windows)
- It just works. Proper requirements are installed. model weights are automatically downloaded. No huggingface account needed.
(if you have the right hardware... and aren't on windows)
- Noisy logs are gone (which was surprisingly hard to accomplish)
- WeightedPrompts let you smash together separate prompts (cat-dog)
- Tile Mode creates tileable images
@ -73,18 +82,15 @@ imagine_image_files(prompts, outdir="./my-art")
```
# Requirements
- Computer with CUDA supported graphics card. ~10 gb video ram
OR
- Apple M1 computer
## Requirements
- ~10 gb space for models to download
- A decent computer with either a CUDA supported graphics card or M1 processor.
# Improvements from CompVis
## Improvements from CompVis
- img2img actually does # of steps you specify
- performance optimizations
-
# Models Used
## Models Used
- CLIP - https://openai.com/blog/clip/
- LDM - Latent Diffusion
- Stable Diffusion
@ -92,10 +98,13 @@ OR
- https://huggingface.co/CompVis/stable-diffusion-v1-4
- https://laion.ai/blog/laion-5b/
# Todo
- performance optimizations
- https://github.com/huggingface/diffusers/blob/main/docs/source/optimization/fp16.mdx
- https://github.com/neonsecret/stable-diffusion
## Not Supported
- a web interface. this is a python library
## Todo
- performance optimizations
- https://github.com/neonsecret/stable-diffusion https://github.com/CompVis/stable-diffusion/pull/177
- ✅ https://github.com/huggingface/diffusers/blob/main/docs/source/optimization/fp16.mdx
- ✅ https://github.com/CompVis/stable-diffusion/compare/main...Doggettx:stable-diffusion:autocast-improvements#
- ✅ https://www.reddit.com/r/StableDiffusion/comments/xalaws/test_update_for_less_memory_usage_and_higher/
- deploy to pypi
@ -106,14 +115,14 @@ OR
- remove yaml config
- delete more unused code
- Interface improvements
- init-image at command line
- prompt expansion?
- webserver interface (low priority, this is a library)
- ✅ init-image at command line
- prompt expansion
- Image Generation Features
- upscaling
- https://github.com/lowfuel/progrock-stable
- face improvements
- codeformer
- gfpgan - https://github.com/TencentARC/GFPGAN
- codeformer - https://github.com/sczhou/CodeFormer
- image describe feature - https://replicate.com/methexis-inc/img2prompt
- outpainting
- inpainting
@ -135,5 +144,3 @@ OR
- https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/sd_textual_inversion_training.ipynb#scrollTo=50JuJUM8EG1h
- zooming videos? a la disco diffusion
- fix saturation at high CFG https://www.reddit.com/r/StableDiffusion/comments/xalo78/fixing_excessive_contrastsaturation_resulting/

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

@ -57,7 +57,8 @@ def configure_logging(level="INFO"):
)
@click.option(
"--init-image-strength",
default=0.3,
default=0.6,
show_default=True,
help="Starting image.",
)
@click.option("--outdir", default="./outputs", help="where to write results to")
@ -143,6 +144,8 @@ def imagine_cmd(
logger.info(
f"🤖🧠 received {len(prompt_texts)} prompt(s) and will repeat them {repeats} times to create {total_image_count} images."
)
if init_image and sampler_type != "DDIM":
sampler_type = "DDIM"
prompts = []
load_model(tile_mode=tile)

@ -128,7 +128,7 @@ class DDIMSampler:
# sampling
C, H, W = shape
size = (batch_size, C, H, W)
logger.info(f"Data shape for DDIM sampling is {size}, eta {eta}")
logger.debug(f"Data shape for DDIM sampling is {size}, eta {eta}")
samples, intermediates = self.ddim_sampling(
conditioning,
@ -351,7 +351,7 @@ class DDIMSampler:
time_range = np.flip(timesteps)
total_steps = timesteps.shape[0]
logger.info(f"Running DDIM Sampling with {total_steps} timesteps")
logger.debug(f"Running DDIM Sampling with {total_steps} timesteps")
iterator = tqdm(time_range, desc="Decoding image", total=total_steps)
x_dec = x_latent

@ -1,9 +1,16 @@
from setuptools import find_packages, setup
with open("README.md", "r", encoding="utf-8") as f:
readme = f.read()
setup(
name="imaginairy",
version="0.0.1",
description="AI imagined images.",
name="imaginAIry",
author="Bryce Drennan",
author_email="b r y p y d o t io",
version="0.7.0",
description="AI imagined images. Pythonic generation of stable diffusion images.",
long_description=readme,
long_description_content_type="text/markdown",
packages=find_packages(include=("imaginairy", "imaginairy.*")),
entry_points={
"console_scripts": ["imagine=imaginairy.cmd_wrap:imagine_cmd"],

Loading…
Cancel
Save