itacaiunas commited on
Commit
6318867
1 Parent(s): 825377b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -147
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Fábrica de Quadrinhos IA
3
  emoji: 📚
4
  colorFrom: blue
5
  colorTo: green
@@ -9,152 +9,10 @@ app_port: 3000
9
  disable_embedding: false
10
  ---
11
 
12
- # AI Comic Factory
13
 
14
- *(note: the website "aicomicfactory.com" is not affiliated with the AI Comic Factory project, nor it is created or maintained by the AI Comic Factory team. If you see their website has an issue, please contact them directly)*
15
 
16
- ## Running the project at home
17
 
18
- First, I would like to highlight that everything is open-source (see [here](https://huggingface.co/spaces/jbilcke-hf/ai-comic-factory/tree/main), [here](https://huggingface.co/spaces/jbilcke-hf/VideoChain-API/tree/main), [here](https://huggingface.co/spaces/hysts/SD-XL/tree/main), [here](https://github.com/huggingface/text-generation-inference)).
19
-
20
- However the project isn't a monolithic Space that can be duplicated and ran immediately:
21
- it requires various components to run for the frontend, backend, LLM, SDXL etc.
22
-
23
- If you try to duplicate the project, open the `.env` you will see it requires some variables.
24
-
25
- Provider config:
26
- - `LLM_ENGINE`: can be one of: "INFERENCE_API", "INFERENCE_ENDPOINT", "OPENAI"
27
- - `RENDERING_ENGINE`: can be one of: "INFERENCE_API", "INFERENCE_ENDPOINT", "REPLICATE", "VIDEOCHAIN", "OPENAI" for now, unless you code your custom solution
28
-
29
- Auth config:
30
- - `AUTH_HF_API_TOKEN`: only if you decide to use OpenAI for the LLM engine necessary if you decide to use an inference api model or a custom inference endpoint
31
- - `AUTH_OPENAI_TOKEN`: only if you decide to use OpenAI for the LLM engine
32
- - `AITH_VIDEOCHAIN_API_TOKEN`: secret token to access the VideoChain API server
33
- - `AUTH_REPLICATE_API_TOKEN`: in case you want to use Replicate.com
34
-
35
- Rendering config:
36
- - `RENDERING_HF_INFERENCE_ENDPOINT_URL`: necessary if you decide to use a custom inference endpoint
37
- - `RENDERING_REPLICATE_API_MODEL_VERSION`: url to the VideoChain API server
38
- - `RENDERING_HF_INFERENCE_ENDPOINT_URL`: optional, default to nothing
39
- - `RENDERING_HF_INFERENCE_API_BASE_MODEL`: optional, defaults to "stabilityai/stable-diffusion-xl-base-1.0"
40
- - `RENDERING_HF_INFERENCE_API_REFINER_MODEL`: optional, defaults to "stabilityai/stable-diffusion-xl-refiner-1.0"
41
- - `RENDERING_REPLICATE_API_MODEL`: optional, defaults to "stabilityai/sdxl"
42
- - `RENDERING_REPLICATE_API_MODEL_VERSION`: optional, in case you want to change the version
43
-
44
- Language model config:
45
- - `LLM_HF_INFERENCE_ENDPOINT_URL`: "<use your own>"
46
- - `LLM_HF_INFERENCE_API_MODEL`: "codellama/CodeLlama-7b-hf"
47
-
48
- In addition, there are some community sharing variables that you can just ignore.
49
- Those variables are not required to run the AI Comic Factory on your own website or computer
50
- (they are meant to create a connection with the Hugging Face community,
51
- and thus only make sense for official Hugging Face apps):
52
- - `NEXT_PUBLIC_ENABLE_COMMUNITY_SHARING`: you don't need this
53
- - `COMMUNITY_API_URL`: you don't need this
54
- - `COMMUNITY_API_TOKEN`: you don't need this
55
- - `COMMUNITY_API_ID`: you don't need this
56
-
57
- Please read the `.env` default config file for more informations.
58
- To customise a variable locally, you should create a `.env.local`
59
- (do not commit this file as it will contain your secrets).
60
-
61
- -> If you intend to run it with local, cloud-hosted and/or proprietary models **you are going to need to code 👨‍💻**.
62
-
63
- ## The LLM API (Large Language Model)
64
-
65
- Currently the AI Comic Factory uses [Llama-2 70b](https://huggingface.co/blog/llama2) through an [Inference Endpoint](https://huggingface.co/docs/inference-endpoints/index).
66
-
67
- You have three options:
68
-
69
- ### Option 1: Use an Inference API model
70
-
71
- This is a new option added recently, where you can use one of the models from the Hugging Face Hub. By default we suggest to use CodeLlama 34b as it will provide better results than the 7b model.
72
-
73
- To activate it, create a `.env.local` configuration file:
74
-
75
- ```bash
76
- LLM_ENGINE="INFERENCE_API"
77
-
78
- HF_API_TOKEN="Your Hugging Face token"
79
-
80
- # codellama/CodeLlama-7b-hf" is used by default, but you can change this
81
- # note: You should use a model able to generate JSON responses,
82
- # so it is storngly suggested to use at least the 34b model
83
- HF_INFERENCE_API_MODEL="codellama/CodeLlama-7b-hf"
84
- ```
85
-
86
- ### Option 2: Use an Inference Endpoint URL
87
-
88
- If you would like to run the AI Comic Factory on a private LLM running on the Hugging Face Inference Endpoint service, create a `.env.local` configuration file:
89
-
90
- ```bash
91
- LLM_ENGINE="INFERENCE_ENDPOINT"
92
-
93
- HF_API_TOKEN="Your Hugging Face token"
94
-
95
- HF_INFERENCE_ENDPOINT_URL="path to your inference endpoint url"
96
- ```
97
-
98
- To run this kind of LLM locally, you can use [TGI](https://github.com/huggingface/text-generation-inference) (Please read [this post](https://github.com/huggingface/text-generation-inference/issues/726) for more information about the licensing).
99
-
100
- ### Option 3: Use an OpenAI API Key
101
-
102
- This is a new option added recently, where you can use OpenAI API with an OpenAI API Key.
103
-
104
- To activate it, create a `.env.local` configuration file:
105
-
106
- ```bash
107
- LLM_ENGINE="OPENAI"
108
-
109
- # default openai api base url is: https://api.openai.com/v1
110
- LLM_OPENAI_API_BASE_URL="Your OpenAI API Base URL"
111
-
112
- LLM_OPENAI_API_MODEL="gpt-3.5-turbo"
113
-
114
- AUTH_OPENAI_API_KEY="Your OpenAI API Key"
115
- ```
116
-
117
- ### Option 4: Fork and modify the code to use a different LLM system
118
-
119
- Another option could be to disable the LLM completely and replace it with another LLM protocol and/or provider (eg. Claude, Replicate), or a human-generated story instead (by returning mock or static data).
120
-
121
- ### Notes
122
-
123
- It is possible that I modify the AI Comic Factory to make it easier in the future (eg. add support for Claude or Replicate)
124
-
125
- ## The Rendering API
126
-
127
- This API is used to generate the panel images. This is an API I created for my various projects at Hugging Face.
128
-
129
- I haven't written documentation for it yet, but basically it is "just a wrapper ™" around other existing APIs:
130
-
131
- - The [hysts/SD-XL](https://huggingface.co/spaces/hysts/SD-XL?duplicate=true) Space by [@hysts](https://huggingface.co/hysts)
132
- - And other APIs for making videos, adding audio etc.. but you won't need them for the AI Comic Factory
133
-
134
- ### Option 1: Deploy VideoChain yourself
135
-
136
- You will have to [clone](https://huggingface.co/spaces/jbilcke-hf/VideoChain-API?duplicate=true) the [source-code](https://huggingface.co/spaces/jbilcke-hf/VideoChain-API/tree/main)
137
-
138
- Unfortunately, I haven't had the time to write the documentation for VideoChain yet.
139
- (When I do I will update this document to point to the VideoChain's README)
140
-
141
-
142
- ### Option 2: Use Replicate
143
-
144
- To use Replicate, create a `.env.local` configuration file:
145
-
146
- ```bash
147
- RENDERING_ENGINE="REPLICATE"
148
-
149
- RENDERING_REPLICATE_API_MODEL="stabilityai/sdxl"
150
-
151
- RENDERING_REPLICATE_API_MODEL_VERSION="da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf"
152
-
153
- AUTH_REPLICATE_API_TOKEN="Your Replicate token"
154
- ```
155
-
156
- ### Option 3: Use another SDXL API
157
-
158
- If you fork the project you will be able to modify the code to use the Stable Diffusion technology of your choice (local, open-source, proprietary, your custom HF Space etc).
159
-
160
- It would even be something else, such as Dall-E.
 
1
  ---
2
+ title: Quadrinhos IA
3
  emoji: 📚
4
  colorFrom: blue
5
  colorTo: green
 
9
  disable_embedding: false
10
  ---
11
 
12
+ # Quadrinhos IA
13
 
14
+ Este app foi editado a partir do código aberto (open source) do projeto AI Comic Factory.
15
 
16
+ No entanto, o projeto não é um espaço monolítico que pode ser duplicado e executado imediatamente: requer vários componentes para serem executados no frontend, backend, LLM, SDXL etc.
17
 
18
+ Se você tentar duplicar o projeto, abra o `.env` e verá que ele requer algumas variáveis.