Muhammadreza commited on
Commit
8e3acb1
·
1 Parent(s): 0bf332e

added: tutorial for users who want to run the code on their servers/local machines.

Browse files
Files changed (1) hide show
  1. README.md +44 -2
README.md CHANGED
@@ -7,11 +7,53 @@ tags:
7
 
8
  ## What is Voyage?
9
 
10
- [Voyage](https://huggingface.co/openvoyage/voyage-v1) is basically a _text to image_ model developed by [Muhammadreza Haghiri](https://haghiri75.com) and it is based on weights from Stable Diffusion version 2.0 and Midjourney version 4. This model helps creative people turn their ideas to artwork for free (in any sense of the word _free_).
11
 
12
  ## How to use voyage with `diffusers` lib
13
 
14
- TODO
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  ## Colab notebook
17
 
 
7
 
8
  ## What is Voyage?
9
 
10
+ [Voyage](https://huggingface.co/openvoyage/voyage-v1) is basically a _text to image_ model developed by [Muhammadreza Haghiri](https://haghiri75.com/en) and it is based on weights from Stable Diffusion version 2.0 and Midjourney version 4. This model helps creative people turn their ideas to artwork for free (in any sense of the word _free_).
11
 
12
  ## How to use voyage with `diffusers` lib
13
 
14
+ ### Installing needed libraries
15
+
16
+ ```
17
+ !pip install --upgrade git+https://github.com/huggingface/diffusers.git transformers scipy ftfy accelerate
18
+ ```
19
+
20
+ ### Importing required libraries, functions and classes
21
+
22
+ These following libraries, functions and classes used by me in order to test the model. Feel free to add more of your need or remove unnecessary ones!
23
+
24
+ ```python
25
+ from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler, DiffusionPipeline, DPMSolverMultistepScheduler
26
+ import torch
27
+ ```
28
+
29
+ ### Setting up the model and scheduler
30
+
31
+ In order to get results like what I got, you have to set `euler` scheduler up. This is how you can get it:
32
+
33
+ ```python
34
+ model_id = "openvoyage/voyage-v1"
35
+
36
+ scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
37
+ pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float16)
38
+ pipe = pipe.to("cuda")
39
+ ```
40
+
41
+ but if you need DPMS scheduler, you can use this line as well:
42
+
43
+ ```python
44
+ scheduler = DPMSolverMultistepScheduler.from_pretrained(model_id, subfolder="scheduler")
45
+ ```
46
+
47
+ ### Inference
48
+
49
+ ```python
50
+ prompt = "ultra realistic illustration of a young beautiful woman, intricate, elegant, sharp focus, smooth edges"
51
+ negative_prompt = ""
52
+ prompt = f'<voyage> style {prompt}'
53
+ image = pipe(prompt=prompt, negative_prompt=negative_prompt, num_inference_steps=25, width=512, height=512, guidance_scale=10).images[0]
54
+ ```
55
+
56
+ and in order to save your images, you can use `image.save()` method and have it in PNG format.
57
 
58
  ## Colab notebook
59