Pushpendrasinghparmar commited on
Commit
cfbd2ef
·
verified ·
1 Parent(s): 4769f16

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -12
README.md CHANGED
@@ -14,22 +14,22 @@ pipeline_tag: text-to-image
14
  import torch
15
  from diffusers import AutoPipelineForText2Image
16
 
17
- # PEFT 라이브러리 필요 (LoRA 로딩용)
18
  from peft import PeftModel, PeftConfig
19
 
20
- # 기기 설정
21
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
22
 
23
- # 기본 모델 로드
24
- print("기본 FLUX 모델 로드 중...")
25
  pipe = AutoPipelineForText2Image.from_pretrained(
26
  "black-forest-labs/FLUX.1-dev",
27
- torch_dtype=torch.float16 # bfloat16 대신 float16 사용
28
  )
29
  pipe.to(device)
30
 
31
- # Uncensored LoRA 로드
32
- print("Uncensored LoRA 로드 중...")
33
  pipe.load_lora_weights(
34
  'Heartsync/Flux-NSFW-uncensored',
35
  weight_name='lora.safetensors',
@@ -37,14 +37,11 @@ pipe.load_lora_weights(
37
  )
38
 
39
  # 이미지 생성
40
- prompt = "A woman in a sheer white dress standing on a beach at sunset, backlit so her silhouette is visible through the thin fabric, shot with Canon EOS R5, 85mm f/1.2 lens, golden hour natural lighting, professional composition, hyperrealistic detail, masterpiece quality, 8K resolution."
41
- negative_prompt = "text, watermark, signature, cartoon, anime, illustration, painting, drawing, low quality, blurry"
42
 
43
- # 시드 설정
44
  seed = 42
45
  generator = torch.Generator(device=device).manual_seed(seed)
46
 
47
- # 이미지 생성
48
  image = pipe(
49
  prompt=prompt,
50
  negative_prompt=negative_prompt,
@@ -55,6 +52,5 @@ image = pipe(
55
  generator=generator,
56
  ).images[0]
57
 
58
- # 이미지 저장
59
  image.save("generated_image.png")
60
  ```
 
14
  import torch
15
  from diffusers import AutoPipelineForText2Image
16
 
17
+ # PEFT
18
  from peft import PeftModel, PeftConfig
19
 
20
+ #
21
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
22
 
23
+ #
24
+ print("In progress...")
25
  pipe = AutoPipelineForText2Image.from_pretrained(
26
  "black-forest-labs/FLUX.1-dev",
27
+ torch_dtype=torch.float16 # bfloat16
28
  )
29
  pipe.to(device)
30
 
31
+ #
32
+ print("Loading lora 로드 중...")
33
  pipe.load_lora_weights(
34
  'Heartsync/Flux-NSFW-uncensored',
35
  weight_name='lora.safetensors',
 
37
  )
38
 
39
  # 이미지 생성
40
+ prompt = "A woman in a sheer white dress standing on a beach at sunset"
 
41
 
 
42
  seed = 42
43
  generator = torch.Generator(device=device).manual_seed(seed)
44
 
 
45
  image = pipe(
46
  prompt=prompt,
47
  negative_prompt=negative_prompt,
 
52
  generator=generator,
53
  ).images[0]
54
 
 
55
  image.save("generated_image.png")
56
  ```