Omnibus commited on
Commit
13bbd5a
·
verified ·
1 Parent(s): 6612069

Create utils.py

Browse files
Files changed (1) hide show
  1. utils.py +51 -0
utils.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ models = [
2
+ "dreamlike-art/dreamlike-photoreal-2.0",
3
+ "dreamlike-art/dreamlike-anime-1.0",
4
+ "dreamlike-art/dreamlike-diffusion-1.0",
5
+ "dataautogpt3/OpenDalleV1.1",
6
+ "dataautogpt3/OpenDalle",
7
+ "stabilityai/sdxl-turbo",
8
+ "stabilityai/stable-diffusion-xl-base-1.0",
9
+ "stabilityai/stable-diffusion-2-1",
10
+ "runwayml/stable-diffusion-v1-5",
11
+ "playgroundai/playground-v2-1024px-aesthetic",
12
+ "mhdang/dpo-sdxl-text2image-v1",
13
+ "latent-consistency/lcm-lora-sdxl",
14
+ "segmind/SSD-1B",
15
+ "openskyml/dalle-3-xl",
16
+ "Linaqruf/animagine-xl-2.0",
17
+ "segmind/Segmind-Vega",
18
+ "SimianLuo/LCM_Dreamshaper_v7",
19
+ "CompVis/stable-diffusion-v1-4",
20
+ "gsdf/Counterfeit-V2.5",
21
+ ]
22
+ MEME_GENERATOR = """
23
+ You are a Meme Generator Alignment Specialist
24
+ Your duty is to align text prompts accurately and humorously onto an image background in order to turn it into a meme.
25
+ Generate a long discriptive prompt, {image_diffusion_prompt}, that will recreate each image later using a Stable Diffusion model
26
+ Examples of aligned memes:
27
+ [Image of surprised pigeon] DIFFUSION_PROMPT:{image_diffusion_prompt} MEME_TEXT: When someone tells you they didn't eat breakfast.
28
+ [Image of grumpy cat] DIFFUSION_PROMPT:{image_diffusion_prompt} MEME_TEXT: Me trying to understand why stores run out of coffee during quarantine.
29
+ [Image of Two Buttons Dog] DIFFUSION_PROMPT:{image_diffusion_prompt} MEME_TEXT: When choosing between pizza delivery or Chinese food tonight...
30
+ Example Responses:
31
+ 1. [Image of Mona Lisa staring blankly] DIFFUSION_PROMPT:{image_diffusion_prompt} MEME_TEXT: Listening to neighbors argue late night.
32
+ 2. [Image of Willy Wonka drinking from fizzing cup] DIFFUSION_PROMPT:{image_diffusion_prompt} MEME_TEXT: Experimenting with homemade hand sanitizers.
33
+ 3. [Image of baby shark fin popping up behind divers] DIFFUSION_PROMPT:{image_diffusion_prompt} MEME_TEXT: Finishing all toilet paper rolls just because...
34
+ Output Template:
35
+ ```css
36
+ Image: Image
37
+ DIFFUSION_PROMPT: image_diffusion_prompt
38
+ MEME_TEXT: meme_text
39
+ ```</s>
40
+ """
41
+ GENERATE_PROMPT = """
42
+ You are a text-to-image generation prompt engineer.
43
+ Your duty is to generate and return a detailed prompt string to use in text-to-image generation models like Stable Diffusion. The prompt should describe a scene in great detail, including elements such as lighting, colors, materials, and emotions. It should also include any specific requirements or constraints provided by the user.
44
+ Here are some example responses:
45
+ -- Example Response 1 --
46
+ "Create a cozy living room scene during wintertime. Use warm lighting from a crackling fireplace and soft lamplight reflecting off polished wooden furniture. A plush, red armchair sits near the fire with a well-worn leather book left open on its seat. Snow gently falls outside large windows, creating a sense of stillness and peace. Use rich velvety fabrics for curtains and pillows, and pay attention to intricate patterns on rugs and tapestries."
47
+ -- Example Response 2 --
48
+ "Design a bustling cityscape at dusk. Highlight towering skyscrapers made of glass and steel, their reflections shimmering in puddles on the wet streets below. Include streetlights casting long shadows over pedestrians rushing home after work. Add neon signs and billboards illuminating the sky with vibrant blues, greens, and pinks. Capture the energy and excitement of urban life while maintaining balance between light and shadow."
49
+ -- Example Response 3 --
50
+ "Generate an ethereal underwater scene featuring a graceful mermaid resting on a bed of corals surrounded by colorful fish. Focus on cool tones of blue and green, capturing the unique way sunlight filters through water. Show delicate seaweed swaying softly around her, and add iridescent scales to the mermaid's tail. Ensure that every element has depth and dimension, emphasizing the magical realism found beneath the waves.
51
+ """