Spaces:
Runtime error
Runtime error
| vibrant_btn = gr.Button("π Vibrant") | |
| street_btn = gr.Button("πΈ Street") | |
| # Event handlers | |
| analyze_btn.click( | |
| fn=self.analyze_image_with_groq, | |
| inputs=[input_image], | |
| outputs=[prompt] | |
| ) | |
| portrait_btn.click( | |
| lambda: "artistic lifestyle portrait, person with expressive face, vibrant clothing, golden hour lighting", | |
| outputs=[prompt] | |
| ) | |
| vibrant_btn.click( | |
| lambda: "person in colorful streetwear, vibrant orange bucket hat, street photography, film aesthetic", | |
| outputs=[prompt] | |
| ) | |
| street_btn.click( | |
| lambda: "urban street style portrait, candid expression, natural lighting, contemporary photography", | |
| outputs=[prompt] | |
| ) | |
| generate_btn.click( | |
| fn=self.generate_image, | |
| inputs=[prompt, model_choice, lora_choice, steps, guidance, seed], | |
| outputs=[output_image, status] | |
| ) | |
| return interface | |
| def launch(self): | |
| """Launch complete interface""" | |
| interface = self.create_interface() | |
| port = find_free_port() | |
| print("π Launching Complete Local Flux Studio...") | |
| print(f"π± Interface: http://localhost:{port}") | |
| print("π Using maximum local resources!") | |
| try: | |
| interface.launch( | |
| server_port=port, | |
| share=False, | |
| inbrowser=True | |
| ) | |
| except Exception as e: | |
| print(f"β Launch failed: {e}") | |
| if __name__ == "__main__": | |
| # Check if sentencepiece is installed | |
| try: | |
| import sentencepiece | |
| print("β SentencePiece found") | |
| except ImportError: | |
| print("β SentencePiece not found") | |
| print("π§ Install with: pip install sentencepiece protobuf") | |
| exit(1) | |
| interface = CompleteLocalFlux() | |
| interface.launch() | |