seawolf2357 commited on
Commit
c957c32
·
verified ·
1 Parent(s): b238a96

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -15
app.py CHANGED
@@ -16,7 +16,7 @@ if not os.path.exists(SAVE_DIR):
16
 
17
  device = "cuda" if torch.cuda.is_available() else "cpu"
18
  repo_id = "black-forest-labs/FLUX.1-dev"
19
- adapter_id = "openfree/van-gogh" # Changed to van Gogh model
20
 
21
  pipeline = DiffusionPipeline.from_pretrained(repo_id, torch_dtype=torch.bfloat16)
22
  pipeline.load_lora_weights(adapter_id)
@@ -74,22 +74,22 @@ def inference(
74
  # Return just the image and seed
75
  return image, seed
76
 
77
- # Updated examples with 1880s clothing style for Van Gogh
78
  examples = [
79
- "van Gogh's painting of a lively outdoor gathering in the 1880s, with men in formal top hats, frock coats, and women in bustled dresses with elaborate hats, enjoying a summer afternoon. The scene captures the Belle Époque atmosphere with swirling brushstrokes and vibrant colors typical of van Gogh, highlighting the fashionable attire of the period. [trigger]",
80
- "van Gogh's intimate portrait of a young woman from the 1880s, with her hair styled in a fashionable updo, wearing a high-necked dress with lace details and leg-of-mutton sleeves. She wears delicate jewelry and has the expressive, bold brushstrokes and vibrant color palette characteristic of van Gogh's portraiture. [trigger]",
81
- "van Gogh's painting of two young girls in 1880s attire seated at a piano. One plays while the other stands nearby, both dressed in white frocks with ribbon details, sashes, and high collars typical of the period. The interior setting features swirling patterns, intense colors, and the bold impasto technique typical of van Gogh's style. [trigger]",
82
- "van Gogh's painting of an elegant 1880s boating party, with gentlemen in striped boating blazers, straw boater hats, and formal trousers, alongside ladies in bustled day dresses with parasols. The scene captures the leisure activities of French society during the Belle Époque era, rendered with the artist's characteristic swirling brushstrokes and vibrant contrasting colors. [trigger]",
83
- "van Gogh's painting of children playing in an 1880s garden scene, dressed in formal period children's wear including sailor suits for boys and pinafores with full skirts for girls. Their Victorian-era clothing contrasts with their playful activities, set against van Gogh's vibrant treatment of nature with bold, expressive brushstrokes and dramatic color combinations. [trigger]",
84
- "van Gogh's depiction of bathers in 1880s swimming attire, showing the modest bathing costumes of the period. Women wear full-coverage dark bathing dresses with stockings, while men are in knee-length swimming suits. The figures are arranged against a backdrop of water and landscape rendered in van Gogh's distinctive swirling brushwork and bold chromatic contrasts. [trigger]"
85
  ]
86
 
87
- # Improved custom CSS with better visuals - updated colors for Van Gogh theme
88
  custom_css = """
89
  :root {
90
- --color-primary: #1A3A8F;
91
- --color-secondary: #E09900;
92
- --background-fill-primary: linear-gradient(to right, #f6f9fc, #f0f4e3);
93
  }
94
 
95
  footer {
@@ -107,7 +107,7 @@ footer {
107
  text-align: center;
108
  margin: 1rem 0;
109
  text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
110
- font-family: 'Playfair Display', serif;
111
  }
112
 
113
  .subtitle {
@@ -170,18 +170,19 @@ button:hover {
170
  border-radius: 10px;
171
  padding: 1rem;
172
  margin-top: 1rem;
 
173
  }
174
  """
175
 
176
  with gr.Blocks(css=custom_css, analytics_enabled=False) as demo:
177
- gr.HTML('<div class="title">Vincent van Gogh STUDIO</div>')
178
 
179
  # Add collection link below title
180
  gr.HTML('<div class="collection-link"><a href="https://huggingface.co/collections/openfree/painting-art-ai-681453484ec15ef5978bbeb1" target="_blank">View the full Painting Art AI Collection</a></div>')
181
 
182
  # Model description with the requested content
183
  with gr.Group(elem_classes="model-description"):
184
- gr.HTML('<p>Generate beautiful artwork in the style of Vincent van Gogh. Add [trigger] at the end of your prompt for best results.</p>')
185
 
186
  # Simplified structure without tabs and gallery
187
  with gr.Column(elem_id="col-container"):
 
16
 
17
  device = "cuda" if torch.cuda.is_available() else "cpu"
18
  repo_id = "black-forest-labs/FLUX.1-dev"
19
+ adapter_id = "openfree/winslow-homer" # Changed to Winslow Homer model
20
 
21
  pipeline = DiffusionPipeline.from_pretrained(repo_id, torch_dtype=torch.bfloat16)
22
  pipeline.load_lora_weights(adapter_id)
 
74
  # Return just the image and seed
75
  return image, seed
76
 
77
+ # Updated examples with 1880s clothing style for Winslow Homer
78
  examples = [
79
+ "Winslow Homer's painting of a lively outdoor gathering in the 1880s, with men in formal top hats, frock coats, and women in bustled dresses with elaborate hats, enjoying a summer afternoon. The scene captures the Belle Époque atmosphere with Homer's characteristic realism and attention to natural light, highlighting the fashionable attire of the period. [trigger]",
80
+ "Winslow Homer's intimate portrait of a young woman from the 1880s, with her hair styled in a fashionable updo, wearing a high-necked dress with lace details and leg-of-mutton sleeves. She wears delicate jewelry and has the soft, naturalistic features characteristic of Homer's portraiture, set against a coastal backdrop with dramatic light and shadow. [trigger]",
81
+ "Winslow Homer's painting of two young girls in 1880s attire seated near a window. One plays with a toy while the other stands nearby, both dressed in white frocks with ribbon details, sashes, and high collars typical of the period. The interior setting features natural sunlight streaming in, creating Homer's distinctive interplay of light and shadow. [trigger]",
82
+ "Winslow Homer's painting of an elegant 1880s boating party, with gentlemen in striped boating blazers, straw boater hats, and formal trousers, alongside ladies in bustled day dresses with parasols. The scene captures the leisure activities near the water, with Homer's masterful depiction of reflections and maritime atmosphere. [trigger]",
83
+ "Winslow Homer's painting of children playing in an 1880s seaside scene, dressed in formal period children's wear including sailor suits for boys and pinafores with full skirts for girls. Their Victorian-era clothing contrasts with their playful activities, set against Homer's dramatic seascapes with crashing waves and atmospheric skies. [trigger]",
84
+ "Winslow Homer's depiction of figures in 1880s attire by a rugged coastline, showing the modest clothing of the period. Women wear full-coverage dark dresses with white details, while men are in work clothes or formal attire. The figures are arranged against a backdrop of dramatic ocean waves and weather, showcasing Homer's skill at capturing the relationship between humans and nature. [trigger]"
85
  ]
86
 
87
+ # Improved custom CSS with better visuals - updated colors for Winslow Homer theme
88
  custom_css = """
89
  :root {
90
+ --color-primary: #2B5F75;
91
+ --color-secondary: #D98542;
92
+ --background-fill-primary: linear-gradient(to right, #e8f4f8, #f4e8d8);
93
  }
94
 
95
  footer {
 
107
  text-align: center;
108
  margin: 1rem 0;
109
  text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
110
+ font-family: 'Georgia', serif;
111
  }
112
 
113
  .subtitle {
 
170
  border-radius: 10px;
171
  padding: 1rem;
172
  margin-top: 1rem;
173
+ border: 1px solid #d0e0e3;
174
  }
175
  """
176
 
177
  with gr.Blocks(css=custom_css, analytics_enabled=False) as demo:
178
+ gr.HTML('<div class="title">Winslow Homer STUDIO</div>')
179
 
180
  # Add collection link below title
181
  gr.HTML('<div class="collection-link"><a href="https://huggingface.co/collections/openfree/painting-art-ai-681453484ec15ef5978bbeb1" target="_blank">View the full Painting Art AI Collection</a></div>')
182
 
183
  # Model description with the requested content
184
  with gr.Group(elem_classes="model-description"):
185
+ gr.HTML('<p>Generate beautiful artwork in the style of Winslow Homer, the renowned American landscape painter and printmaker. Homer is known for his marine subjects, dramatic seascapes, and realistic depictions of rural and coastal life. Add [trigger] at the end of your prompt for best results.</p>')
186
 
187
  # Simplified structure without tabs and gallery
188
  with gr.Column(elem_id="col-container"):