prithivMLmods commited on
Commit
7751934
1 Parent(s): 2672a84

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +44 -0
README.md CHANGED
@@ -42,7 +42,51 @@ license: creativeml-openrail-m
42
 
43
  <Gallery />
44
 
 
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  ## Trigger words
47
 
48
  You should use `Real Anime` to trigger the image generation.
 
42
 
43
  <Gallery />
44
 
45
+ **The model is still in the training phase. This is not the final version and may contain artifacts and perform poorly in some cases.**
46
 
47
+ ## Setting Up
48
+ ```
49
+ import torch
50
+ from pipelines import DiffusionPipeline
51
+
52
+ base_model = "black-forest-labs/FLUX.1-dev"
53
+ pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
54
+
55
+ lora_repo = "prithivMLmods/Flux-Dev-Real-Anime-LoRA"
56
+ trigger_word = "Real Anime" # Leave trigger_word blank if not used.
57
+ pipe.load_lora_weights(lora_repo)
58
+
59
+ device = torch.device("cuda")
60
+ pipe.to(device)
61
+ ```
62
+ ## app.py
63
+ ```
64
+ import gradio as gr
65
+
66
+ gr.load("prithivMLmods/Flux-Dev-Real-Anime-LoRA").launch()
67
+ ```
68
+ ## pythonproject.py
69
+ ```
70
+ from fastapi import FastAPI
71
+ from fastapi.middleware.cors import CORSMiddleware
72
+ import gradio as gr
73
+
74
+ def image_generator(prompt):
75
+ pass
76
+
77
+ interface = gr.Interface(fn=image_generator, inputs="text", outputs="image")
78
+ app = FastAPI()
79
+
80
+ app.add_middleware(
81
+ CORSMiddleware,
82
+ allow_origins=["*"],
83
+ allow_credentials=True,
84
+ allow_methods=["*"],
85
+ allow_headers=["*"],
86
+ )
87
+
88
+ app = gr.mount_gradio_app(app, interface, path="/")
89
+ ```
90
  ## Trigger words
91
 
92
  You should use `Real Anime` to trigger the image generation.