-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
784 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .kojii_makeitrad import KojiiMakeitradRequest, kojii_makeitrad | ||
from .kojii_chebel import KojiiChebelRequest, kojii_chebel | ||
from .kojii_untitledxyz import KojiiUntitledxyzRequest, kojii_untitledxyz | ||
from .kojii_violetforest import KojiiVioletforestRequest, kojii_violetforest | ||
from .kojii_huemin import KojiiHueminRequest, kojii_huemin |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import random | ||
from enum import Enum | ||
from typing import Optional, List | ||
from pydantic import BaseModel, Field | ||
|
||
from ..plugins import replicate | ||
|
||
|
||
class KojiiHueminRequest(BaseModel): | ||
""" | ||
A request for Huemin endpoint | ||
""" | ||
prompt: Optional[str] = Field(default=None, description="Prompt") | ||
|
||
|
||
def kojii_huemin(request: KojiiHueminRequest, callback=None): | ||
config = { | ||
"mode": "huemin", | ||
"prompt": request.prompt | ||
} | ||
|
||
image_url, thumbnail_url = replicate.sdxl(config) | ||
|
||
return image_url, thumbnail_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
import random | ||
from enum import Enum | ||
from typing import Optional, List | ||
from pydantic import BaseModel, Field | ||
|
||
from ..plugins import replicate | ||
|
||
|
||
class Setting(Enum): | ||
inside = "inside" | ||
outside = "outside" | ||
|
||
class Location(Enum): | ||
jungle = "jungle" | ||
cliff_front = "cliff front" | ||
desert = "desert" | ||
redwood_forest = "redwood forest" | ||
city_suburbia = "city suburbia" | ||
montana_mountains = "montana mountains" | ||
green_hills = "green hills" | ||
|
||
class Time(Enum): | ||
noon = "noon" | ||
dawn = "dawn" | ||
red_sunset = "red sunset" | ||
night = "night" | ||
|
||
class Color(Enum): | ||
default = "default" | ||
orange = "orange" | ||
yellow_green = "yellow/green" | ||
light_blue = "light blue" | ||
light_pink = "light pink" | ||
|
||
class AspectRatio(Enum): | ||
portrait = "portrait" | ||
landscape = "landscape" | ||
square = "square" | ||
|
||
class KojiiMakeitradRequest(BaseModel): | ||
""" | ||
A request for Makeitrad endpoint | ||
""" | ||
setting: Setting | ||
location: Location | ||
time: Time | ||
color: Color | ||
clouds: bool | ||
pool: bool | ||
aspect_ratio: AspectRatio | ||
|
||
|
||
settings = { | ||
"inside": "interior", | ||
"outside": "exterior" | ||
} | ||
|
||
locations = { | ||
"jungle": "surrounded by overgrown plants, in the lush jungle, large leaves", | ||
"cliff front": "cliff ocean front overlooking water, tropical plants", | ||
"desert": "desert (large rock formations:1.5), cactus, succulents and red sands", | ||
"redwood forest": "in the lush redwood forest with a running river", | ||
"city suburbia": "urban city suburbia, (house plants) and (outdoor topiaries:1.5)", | ||
"montana mountains": "dramatic winter snow capped rustic Montana mountains, trees", | ||
"green hills": "rolling green grass hills and colorful wild flowers" | ||
} | ||
|
||
times = { | ||
"noon": "high noon", | ||
"dawn": "dawn light with hazy fog", | ||
"red sunset": "night red sunset", | ||
"night": "dark black night with large moon and stars" | ||
} | ||
|
||
colors = { | ||
"default": "", | ||
"orange": "orange accents", | ||
"yellow/green": "yellow and green accents", | ||
"light blue": "light blue accents", | ||
"light pink": "light pink accents" | ||
} | ||
|
||
resolutions = { | ||
"portrait": (768, 1344), | ||
"landscape": (1344, 768), | ||
"square": (1024, 1024) | ||
} | ||
|
||
def kojii_makeitrad(request: KojiiMakeitradRequest, callback=None): | ||
setting = settings[request.setting.value] | ||
location = locations[request.location.value] | ||
time = times[request.time.value] | ||
color = colors[request.color.value] | ||
|
||
clouds = "clouds, " if request.clouds else "" | ||
pool = "(pool:1.5)," if request.pool else "" | ||
|
||
prompt = f"In the style of makeitrad, highly detailed, graphic illustration, almost photorealistic image of an ({setting}:1.5) extra wide angle Landscape mid-century architecture, indoor-outdoor living atrium, {location}, at {time}, {color}, {clouds}{pool} 8k resolution, in the style of midcentury architectural greats. Post and beam, modern glossy, Kodak Portra 100. embedding:makeitrad_embeddings embedding:indoor-outdoor_embeddings" | ||
|
||
neg_pool = "pool, " if not request.pool else "" | ||
neg_clouds = "clouds, " if not request.clouds else "" | ||
|
||
negative_prompt = f"{neg_pool}{neg_clouds} watermark, text, ugly, tiling, out of frame, blurry, blurred, grainy, signature, cut off, draft" | ||
|
||
width, height = resolutions[request.aspect_ratio.value] | ||
|
||
config = { | ||
"mode": "makeitrad", | ||
"text_input": prompt, | ||
"width": width, | ||
"height": height, | ||
"n_samples": 1, | ||
"negative_prompt": negative_prompt, | ||
"guidance_scale": 7, | ||
"seed": random.randint(0, 1000000), | ||
} | ||
|
||
output = replicate.run_task( | ||
config, | ||
model_name="abraham-ai/eden-comfyui" | ||
) | ||
|
||
output = list(output) | ||
image_url = output[0]["files"][0] | ||
thumbnail_url = output[0]["thumbnails"][0] | ||
|
||
return image_url, thumbnail_url | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import random | ||
from enum import Enum | ||
from typing import Optional, List | ||
from pydantic import BaseModel, Field | ||
|
||
from ..plugins import replicate | ||
|
||
|
||
class Type(Enum): | ||
column = "column" | ||
context = "context" | ||
|
||
class KojiiUntitledxyzRequest(BaseModel): | ||
""" | ||
A request for Untitledxyz endpoint | ||
""" | ||
type: Type = Field(default=Type.column, description="Column or Context") | ||
human_machine_nature: float = Field(default=0.5, description="Human (0) vs machine (0.5) vs nature (1)", ge=0.0, le=1.0) | ||
|
||
def kojii_untitledxyz(request: KojiiUntitledxyzRequest, callback=None): | ||
return {"hello": "world"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import random | ||
from enum import Enum | ||
from typing import Optional, List | ||
from pydantic import BaseModel, Field | ||
|
||
from ..plugins import replicate | ||
|
||
|
||
class Style(Enum): | ||
Kawaii = "Kawaii" | ||
Stars = "Stars" | ||
Lace = "Lace" | ||
Flowers = "Flowers" | ||
|
||
class KojiiVioletforestRequest(BaseModel): | ||
""" | ||
A request for VioletForest endpoint | ||
""" | ||
cybertwee_cyberpunk: float = Field(default=0.5, description="Cybertwee vs Cyberpunk", ge=0.0, le=1.0) | ||
style: Style = Field(default=Style.Kawaii, description="Style") | ||
|
||
|
||
def kojii_violetforest(request: KojiiVioletforestRequest, callback=None): | ||
if request.style == Style.Kawaii: | ||
modifiers = "kawaii, kawaii, kawaii, kawaii" | ||
elif request.style == Style.Stars: | ||
modifiers = "stars, stars, stars, stars" | ||
elif request.style == Style.Lace: | ||
modifiers = "lace, lace, lace, lace" | ||
elif request.style == Style.Flowers: | ||
modifiers = "flowers, flowers, flowers, flowers" | ||
|
||
prompt1 = f"a stunning image of a cute cybertwee girl, {modifiers}" | ||
prompt2 = f"a stunning image of an Aston Martin sportscar, {modifiers}" | ||
|
||
config = { | ||
"mode": "create", | ||
"text_input": prompt1, | ||
"lora": "https://edenartlab-prod-data.s3.us-east-1.amazonaws.com/e3b036c0a9949de0a5433cb6c7e54b540c47535ce7ae252948177304542ca4da.tar", | ||
"lora_scale": 0.7, | ||
} | ||
|
||
image_url, thumbnail_url = replicate.sdxl(config) | ||
|
||
return image_url, thumbnail_url |
Oops, something went wrong.