fix: Patch app_flux.py to remove gradio dependency
Browse files59 unmodified lines60616263646559 unmodified lines], check=True)print("[FLUX-Dev] PuLID cloned successfully")# Add to Python pathif pulid_dir not in sys.path:sys.path.insert(0, pulid_dir)59 unmodified lines606162636465666768697071727374757677787980818283848586878859 unmodified lines], check=True)print("[FLUX-Dev] PuLID cloned successfully")# Patch app_flux.py to remove gradio import (not needed for API usage)app_flux_path = os.path.join(pulid_dir, "app_flux.py")if os.path.exists(app_flux_path):print("[FLUX-Dev] Patching app_flux.py to remove gradio dependency...")with open(app_flux_path, "r") as f:content = f.read()# Remove gradio import and related codelines = content.split("\n")patched_lines = []skip_gradio = Falsefor line in lines:# Skip gradio import linesif "import gradio" in line:patched_lines.append("# " + line + " # Removed for API usage")continue# Keep all other linespatched_lines.append(line)with open(app_flux_path, "w") as f:f.write("\n".join(patched_lines))print("[FLUX-Dev] app_flux.py patched successfully")# Add to Python pathif pulid_dir not in sys.path:sys.path.insert(0, pulid_dir)
handler.py+23