diff --git a/daras_ai_v2/base.py b/daras_ai_v2/base.py index 75068f911..28756f96a 100644 --- a/daras_ai_v2/base.py +++ b/daras_ai_v2/base.py @@ -1514,6 +1514,13 @@ def clear_outputs(self): st.session_state.pop(field_name, None) def _render_after_output(self): + if "seed" in self.RequestModel.schema_json(): + randomize = st.button( + ' Regenerate', type="tertiary" + ) + if randomize: + st.session_state[StateKeys.pressed_randomize] = True + st.experimental_rerun() caption = "" caption += f'\\\nGenerated in {st.session_state.get(StateKeys.run_time, 0):.2f}s' if "seed" in self.RequestModel.schema_json(): @@ -1534,13 +1541,6 @@ def render_buttons(self, url: str): url=url, type="secondary", ) - if "seed" in self.RequestModel.schema_json(): - randomize = st.button( - ' Regenerate', type="tertiary" - ) - if randomize: - st.session_state[StateKeys.pressed_randomize] = True - st.experimental_rerun() self._render_report_button() def state_to_doc(self, state: dict):