Fiqa commited on
Commit
257a388
·
verified ·
1 Parent(s): 33407d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -16,6 +16,9 @@ from diffusers import DiffusionPipeline
16
 
17
 
18
 
 
 
 
19
 
20
 
21
 
@@ -83,7 +86,9 @@ def generate_caption_and_image(image):
83
  out = model.generate(**inputs)
84
  caption1 = processor.decode(out[0], skip_special_tokens=True)
85
 
86
- prompt = f'''Create a highly realistic clothing item based on the following descriptions: The design should reflect {caption1} and {caption2}, blending both themes into a single, stylish, and modern piece of clothing. Incorporate highly realistic and high-quality textures that exude sophistication, with realistic fabric lighting and fine details. Subtly hint at {selected_fabric}, featuring a {selected_pattern} motif and a {selected_textile_design} style that harmoniously balances the essence of both captions.'''
 
 
87
 
88
 
89
 
 
16
 
17
 
18
 
19
+ openai_api_key = os.getenv("OPENAI_API_KEY")
20
+ from langchain_openai import OpenAI
21
+ llm =OpenAI(temperature =0.8)
22
 
23
 
24
 
 
86
  out = model.generate(**inputs)
87
  caption1 = processor.decode(out[0], skip_special_tokens=True)
88
 
89
+ prompt = f"Write a prompt to generate clothes based on following info: 1. {caption1} 2. {caption2} 3. {selected_fabric} 4. {selected_pattern} 5. {selected_textile_design} return only prompt enclosed in quotes"
90
+ prompt =llm(prompt)
91
+
92
 
93
 
94