Mikiko Bazeley
commited on
Commit
•
347bec2
1
Parent(s):
57eccf2
Finished troubleshooting
Browse files- .gitignore +1 -0
- pages/1_Generate_Holiday_Postcard.py +21 -1
.gitignore
CHANGED
@@ -293,3 +293,4 @@ cython_debug/
|
|
293 |
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
294 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
295 |
#.idea/
|
|
|
|
293 |
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
294 |
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
295 |
#.idea/
|
296 |
+
.DS_Store
|
pages/1_Generate_Holiday_Postcard.py
CHANGED
@@ -83,6 +83,19 @@ Choose from two FLUX models: whether you’re aiming for lightning speed or extr
|
|
83 |
|
84 |
model_choice = st.selectbox("Select the model:", ["flux-1-schnell-fp8", "flux-1-dev-fp8"])
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
# Dropdown to select an example message or write a custom one
|
87 |
st.divider()
|
88 |
st.subheader("3️⃣ Step 3: Craft the Perfect Message 🎁")
|
@@ -142,7 +155,14 @@ if generate_button:
|
|
142 |
steps = 30 if model_choice == "flux-1-dev-fp8" else 4
|
143 |
|
144 |
# Generate image using the helper utility
|
145 |
-
generated_image = generate_flux_image(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
# Get the selected font path from configuration
|
148 |
font_path = fonts[font_choice]
|
|
|
83 |
|
84 |
model_choice = st.selectbox("Select the model:", ["flux-1-schnell-fp8", "flux-1-dev-fp8"])
|
85 |
|
86 |
+
# Expose parameters like guidance_scale, inference steps, and seed after model selection
|
87 |
+
st.divider()
|
88 |
+
st.subheader("2️⃣A: Customize Your Model Parameters ⚙️")
|
89 |
+
st.markdown("""
|
90 |
+
Now that you've selected your model, fine-tune the parameters to adjust how the FLUX model generates your holiday card.
|
91 |
+
""")
|
92 |
+
|
93 |
+
# Parameter options exposed after model selection
|
94 |
+
guidance_scale = st.slider("Guidance Scale", min_value=0.0, max_value=20.0, value=7.5, step=0.1)
|
95 |
+
num_inference_steps = st.slider("Number of Inference Steps", min_value=1, max_value=100, value=50, step=1)
|
96 |
+
seed = st.slider("Random Seed", min_value=0, max_value=1000, value=42)
|
97 |
+
|
98 |
+
|
99 |
# Dropdown to select an example message or write a custom one
|
100 |
st.divider()
|
101 |
st.subheader("3️⃣ Step 3: Craft the Perfect Message 🎁")
|
|
|
155 |
steps = 30 if model_choice == "flux-1-dev-fp8" else 4
|
156 |
|
157 |
# Generate image using the helper utility
|
158 |
+
generated_image = generate_flux_image(
|
159 |
+
model_path=model_choice, # Correctly pass the model choice
|
160 |
+
api_key=fireworks_api_key, # Fireworks API key
|
161 |
+
prompt=prompt, # User's prompt for generation
|
162 |
+
steps=steps, # Number of inference steps
|
163 |
+
guidance_scale=guidance_scale, # Guidance scale (optional if unchanged)
|
164 |
+
seed=seed # Random seed (optional if unchanged)
|
165 |
+
)
|
166 |
|
167 |
# Get the selected font path from configuration
|
168 |
font_path = fonts[font_choice]
|