Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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/
|
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
|
78 |
examples = [
|
79 |
-
"
|
80 |
-
"
|
81 |
-
"
|
82 |
-
"
|
83 |
-
"
|
84 |
-
"
|
85 |
]
|
86 |
|
87 |
-
# Improved custom CSS with better visuals - updated colors for
|
88 |
custom_css = """
|
89 |
:root {
|
90 |
-
--color-primary: #
|
91 |
-
--color-secondary: #
|
92 |
-
--background-fill-primary: linear-gradient(to right, #
|
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: '
|
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">
|
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
|
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"):
|