prithivMLmods
commited on
Commit
•
05354f6
1
Parent(s):
8e30118
Update README.md
Browse files
README.md
CHANGED
@@ -24,6 +24,52 @@ license: creativeml-openrail-m
|
|
24 |
<Gallery />
|
25 |
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
## Trigger words
|
28 |
|
29 |
You should use `Dress` to trigger the image generation.
|
|
|
24 |
<Gallery />
|
25 |
|
26 |
|
27 |
+
**The model is still in the training phase. This is not the final version and may contain artifacts and perform poorly in some cases.**
|
28 |
+
|
29 |
+
## Setting Up
|
30 |
+
```
|
31 |
+
import torch
|
32 |
+
from pipelines import DiffusionPipeline
|
33 |
+
|
34 |
+
base_model = "black-forest-labs/FLUX.1-dev"
|
35 |
+
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
|
36 |
+
|
37 |
+
lora_repo = "prithivMLmods/Canopus-Flux-LoRA-Hoodies"
|
38 |
+
trigger_word = "Cloth style" # Leave trigger_word blank if not used.
|
39 |
+
pipe.load_lora_weights(lora_repo)
|
40 |
+
|
41 |
+
device = torch.device("cuda")
|
42 |
+
pipe.to(device)
|
43 |
+
```
|
44 |
+
## app.py
|
45 |
+
```
|
46 |
+
import gradio as gr
|
47 |
+
|
48 |
+
gr.load("prithivMLmods/Canopus-Flux-LoRA-Hoodies").launch()
|
49 |
+
```
|
50 |
+
## pythonproject.py
|
51 |
+
```
|
52 |
+
from fastapi import FastAPI
|
53 |
+
from fastapi.middleware.cors import CORSMiddleware
|
54 |
+
import gradio as gr
|
55 |
+
|
56 |
+
def image_generator(prompt):
|
57 |
+
pass
|
58 |
+
|
59 |
+
interface = gr.Interface(fn=image_generator, inputs="text", outputs="image")
|
60 |
+
app = FastAPI()
|
61 |
+
|
62 |
+
app.add_middleware(
|
63 |
+
CORSMiddleware,
|
64 |
+
allow_origins=["*"],
|
65 |
+
allow_credentials=True,
|
66 |
+
allow_methods=["*"],
|
67 |
+
allow_headers=["*"],
|
68 |
+
)
|
69 |
+
|
70 |
+
app = gr.mount_gradio_app(app, interface, path="/")
|
71 |
+
```
|
72 |
+
|
73 |
## Trigger words
|
74 |
|
75 |
You should use `Dress` to trigger the image generation.
|