prithivMLmods
commited on
Commit
•
0f0eb90
1
Parent(s):
6b36341
Update README.md
Browse files
README.md
CHANGED
@@ -90,6 +90,39 @@ pipe.load_lora_weights(lora_repo)
|
|
90 |
device = torch.device("cuda")
|
91 |
pipe.to(device)
|
92 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
## Trigger words
|
95 |
|
|
|
90 |
device = torch.device("cuda")
|
91 |
pipe.to(device)
|
92 |
```
|
93 |
+
## Simple Gradio Implementation
|
94 |
+
|
95 |
+
## app.py
|
96 |
+
```
|
97 |
+
import gradio as gr
|
98 |
+
|
99 |
+
gr.load("models/prithivMLmods/Kepler-452b-LoRA-Flux-Dev-3D-Bubbly").launch()
|
100 |
+
```
|
101 |
+
## pythonproject.py
|
102 |
+
```
|
103 |
+
from fastapi import FastAPI
|
104 |
+
from fastapi.middleware.cors import CORSMiddleware
|
105 |
+
import gradio as gr
|
106 |
+
|
107 |
+
def image_generator(prompt):
|
108 |
+
pass
|
109 |
+
|
110 |
+
interface = gr.Interface(fn=image_generator, inputs="text", outputs="image")
|
111 |
+
app = FastAPI()
|
112 |
+
|
113 |
+
app.add_middleware(
|
114 |
+
CORSMiddleware,
|
115 |
+
allow_origins=["*"],
|
116 |
+
allow_credentials=True,
|
117 |
+
allow_methods=["*"],
|
118 |
+
allow_headers=["*"],
|
119 |
+
)
|
120 |
+
|
121 |
+
app = gr.mount_gradio_app(app, interface, path="/")
|
122 |
+
```
|
123 |
+
## App File Structure
|
124 |
+
|
125 |
+
|
126 |
|
127 |
## Trigger words
|
128 |
|