matteomarjanovic commited on
Commit
fd4ed34
·
1 Parent(s): f792238

concatenate prompt and image generation

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -75,7 +75,7 @@ def generate_description_fn(
75
  {
76
  "type": "text",
77
  "text": """
78
- I want you to imagine how the technical flat sketch of the principal garment in the picture would look like, both front and back, and describe it to me in rich details, in one paragraph.
79
 
80
  The style of the result should look somewhat like the following example:
81
  The technical flat sketch of the dress would depict a midi-length, off-the-shoulder design with a smocked bodice and short puff sleeves that have elasticized cuffs. The elastic neckline sits straight across the chest and back, ensuring a secure fit. The bodice transitions into a flowy, tiered skirt with three evenly spaced gathered panels, creating soft volume. The back view mirrors the front, maintaining the smocked fit and tiered skirt without visible closures, suggesting a pullover style. Elasticized areas would be marked with textured lines, while the gathers and drape would be indicated through subtle curved strokes, ensuring clarity in construction details.
@@ -93,7 +93,19 @@ def generate_description_fn(
93
  model="llama-3.2-11b-vision-preview",
94
  )
95
 
96
- return chat_completion.choices[0].message.content + "In the style of FLTSKC"
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
 
99
  css = """
@@ -143,7 +155,7 @@ with gr.Blocks(css=css) as demo:
143
  inputs=[
144
  input_image,
145
  ],
146
- outputs=[generated_prompt],
147
  )
148
 
149
  if __name__ == "__main__":
 
75
  {
76
  "type": "text",
77
  "text": """
78
+ I want you to imagine how the technical flat sketch of the garment you see in the picture would look like, both front and back, and describe it to me in rich details, in one paragraph.
79
 
80
  The style of the result should look somewhat like the following example:
81
  The technical flat sketch of the dress would depict a midi-length, off-the-shoulder design with a smocked bodice and short puff sleeves that have elasticized cuffs. The elastic neckline sits straight across the chest and back, ensuring a secure fit. The bodice transitions into a flowy, tiered skirt with three evenly spaced gathered panels, creating soft volume. The back view mirrors the front, maintaining the smocked fit and tiered skirt without visible closures, suggesting a pullover style. Elasticized areas would be marked with textured lines, while the gathers and drape would be indicated through subtle curved strokes, ensuring clarity in construction details.
 
93
  model="llama-3.2-11b-vision-preview",
94
  )
95
 
96
+ prompt = chat_completion.choices[0].message.content + " In the style of FLTSKC"
97
+
98
+ image = pipe(
99
+ prompt=prompt,
100
+ guidance_scale=0.,
101
+ num_inference_steps=4,
102
+ width=1420,
103
+ height=1080,
104
+ max_sequence_length=256,
105
+
106
+ ).images[0]
107
+
108
+ return prompt, image
109
 
110
 
111
  css = """
 
155
  inputs=[
156
  input_image,
157
  ],
158
+ outputs=[generated_prompt, result],
159
  )
160
 
161
  if __name__ == "__main__":