Skip to content

Commit

Permalink
prompt multi-select, and other things
Browse files Browse the repository at this point in the history
  • Loading branch information
machado2 committed Jul 4, 2024
1 parent 8c02448 commit a9a4f2c
Show file tree
Hide file tree
Showing 9 changed files with 291 additions and 103 deletions.
3 changes: 2 additions & 1 deletion backend/app/populate_db_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ async def populate_prompts():


async def populate_db_models():
await populate_prompts()
await populate_models()
await populate_styles()
await populate_categories()
await populate_prompts()
1 change: 1 addition & 0 deletions backend/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
DATABASE_HOST = os.getenv('DATABASE_HOST')
DATABASE_PORT = os.getenv('DATABASE_PORT')
DATABASE_PASSWORD = os.getenv('DATABASE_PASSWORD')
PROMPT_KIND = os.getenv('PROMPT_KIND')

TORTOISE_ORM = {
"connections": {
Expand Down
52 changes: 51 additions & 1 deletion backend/app/things_to_draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,55 @@
"A monster shaped like a pillow with soft, fluffy fur and eyes that glow a gentle blue, lounging in a child's bedroom.",
"A spaceship piloted by anthropomorphic cats, navigating an asteroid field with ease while sipping alien beverages.",
"A steampunk dragon with intricate metallic wings and a furnace-like chest, breathing fire mixed with sparks and gears.",
"A mythical creature with the body of a lion, the wings of an eagle, and the tail of a serpent, perched on a rock in a mystical landscape."
"A mythical creature with the body of a lion, the wings of an eagle, and the tail of a serpent, perched on a rock in a mystical landscape.",
"Sunset over a mountain",
"City skyline at night",
"Forest in autumn",
"Beach with palm trees",
"Desert landscape",
"Snow-covered village",
"Underwater coral reef",
"Space with planets and stars",
"Medieval castle",
"Futuristic city",
"Tropical rainforest",
"Farm with a barn and animals",
"Old European street",
"Japanese garden",
"Safari with wild animals",
"Volcano erupting",
"Waterfall in a jungle",
"Lighthouse on a cliff",
"Winter wonderland",
"Ancient ruins",
"Carnival with rides",
"Fairytale forest",
"Garden with flowers",
"Zoo with various animals",
"Island with a lighthouse",
"Ski resort",
"Cave interior",
"Aquarium with marine life",
"Space station",
"Pirate ship on the sea",
"Western desert town",
"Gothic cathedral",
"Vineyard in Tuscany",
"Zen temple",
"Hot air balloon festival",
"Grand Canyon",
"River with boats",
"Fantasy kingdom",
"Medieval market",
"Amusement park",
"Haunted house",
"Steampunk city",
"Mushroom forest",
"Busy airport",
"Rocket launch site",
"Circus tent",
"Ice cave",
"Surfing beach",
"Train station",
"Watermill in the countryside"
]
3 changes: 2 additions & 1 deletion backend/generate-images.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from app.db import init as init_db
from app.exceptions import ImageGenerationException
from app.models import Style, Prompt, StylePromptImage
from app.settings import PROMPT_KIND

image_generator = AiHordeImageGenerator()

Expand Down Expand Up @@ -49,7 +50,7 @@ async def get_missing_images() -> list[QueueItem]:
from itertools import product

styles = await Style.all()
prompts = await Prompt.all()
prompts = await Prompt.filter(kind=PROMPT_KIND).all()
style_prompt_ids = set((spi.style_id, spi.prompt_id) for spi in await StylePromptImage.all())
missing = [QueueItem(style, prompt) for style, prompt in product(styles, prompts) if
(style.id, prompt.id) not in style_prompt_ids]
Expand Down
102 changes: 102 additions & 0 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"react-dom": "^18.3.1",
"react-query": "^3.39.3",
"react-scripts": "5.0.1",
"react-select": "^5.8.0",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
},
Expand Down
Loading

0 comments on commit a9a4f2c

Please sign in to comment.