ACT-images / models /working_flux_script_final.py
DPM1987's picture
Upload folder using huggingface_hub
df83e9f verified
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()